home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / SpeakFreely / src / log.doc < prev    next >
Text File  |  2000-05-18  |  114KB  |  2,413 lines

  1.  
  2.                         Speak Freely for Unix
  3.                           (formerly netfone)
  4.  
  5.                            Development Log
  6.                             by John Walker
  7.                        http://www.fourmilab.ch/
  8.  
  9. 26 August 1995
  10.  
  11. John Gilmore encountered an undefined symbol irint when building on
  12. SunOS 4.1.3_U1.  Apparently this function, which is part of the main C
  13. library in 4.1.1, was moved somewhere else in 4.1.3.  To put an end of
  14. this irint() nonsense once and for all, I rewrote the expression in
  15. soundbyte.c to eliminate the call to irint() entirely.
  16.  
  17. John also suggested making the distribution tar extract into a
  18. netfone-<version> directory as most GNU packages do.  Starting with
  19. release 5.1, which will extract into a netfone-5.1 directory, that's
  20. how it'll be.
  21.  
  22. 29 August 1995
  23.  
  24. Added logic to mike to calculate the precise number of samples which
  25. will fit in a sound buffer to optimally fill a single UDP packet.
  26. John Gilmore pointed out that sending lots of individual packets on
  27. our own is actually more efficient than forcing the network driver to
  28. break large packets into fragments.  It also reduces the sound delay,
  29. since we don't have to wait for a large sound buffer to be filled
  30. before getting it on it's way to the other end.
  31.  
  32. Note that even though mike will now never send a packet larger than
  33. 512 bytes, speaker continues to be able to handle packets with as
  34. many as 8000 samples and thus remains compatible with older versions of
  35. mike.
  36.  
  37. 31 August 1995
  38.  
  39. Added -d and -q switches to speaker which, if specified, override the
  40. debug mode specified in incoming packets.  The -d switch is
  41. particularly handy when you want to log every packet and don't have
  42. control over the sending end.  The -q switch allows running speaker in
  43. the background without worrying about where the output is going to go
  44. is somebody starts sending with debug mode on.
  45.  
  46. To reduce network traffic and improve conference call performance,
  47. I made push-to-talk (-b) mode the default in mike.  Continuous
  48. transmission (unless squelched) is selected with the -a switch.
  49.  
  50. 1 September 1995
  51.  
  52. Added ADPCM compression to mike (enabled by the -f switch) and decompression
  53. to speaker.  ADPCM halves the number of bytes in a packet without substantial
  54. degradation of voice-grade audio, far less than that of the -c switch,
  55. which achieves the same degree of compression.  You can specify -c
  56. and -f together for a 4x reduction in bandwidth, with substantial loss
  57. of quality.  ADPCM and GSM compression cannot be used simultaneously.
  58.  
  59. ADPCM compression is provided primarily as an alternative to Simple
  60. (-c) compression for users with a 64 Kb connection who don't have a
  61. fast enough CPU to run GSM.  ADPCM is much faster on both compression and
  62. decompression than GSM.
  63.  
  64. 2 September 1995
  65.  
  66. Release 5.1.
  67.  
  68. 15 September 1995
  69.  
  70. Implemented a crude but better-than-nothing "answering machine" in
  71. speaker.  Specifying the "-rfile" option records all sound received
  72. in the named file in Sun .au format (including header).  If you
  73. specify "-r+file" the sound is appended to the named file if it
  74. exists.  As with a real answering machine with the volume turned up,
  75. the sound is still played.  Obviously there are a zillion nice things
  76. that one can immediately think of which would improve this feature,
  77. but at least it provides a stopgap which captures attempts to
  78. communicate while you were away from the machine.
  79.  
  80. 17 September 1995
  81.  
  82. Discovered that a "quick fix" in the SGI audio input soundgrab()
  83. function in soundbyte.c was violating the maximum packet size for
  84. memory-constrained versions of WINSOCK. Fixing that was
  85. straightforward, but I ran squarely into a bug where we'd hang trying
  86. to flush queued input when transitioning to talk mode in push-to-talk.
  87. I added a new soundflush() function dedicated to flushing the input
  88. queue (however that is accomplished) and provided Sun and SGI
  89. implementations of this function.
  90.  
  91. Lots of little changes all over to transition the package name from
  92. Netfone to Speak Freely for Unix.  Much more remains to be done,
  93. particularly separating the option sections for sfmike and sfspeaker
  94. in the man page.
  95.  
  96. 19 September 1995
  97.  
  98. Finished changes to programs, Makefile, and manual page for renaming
  99. to Speak Freely for Unix.
  100.  
  101. Version 5.2 released.
  102.  
  103. 20 September 1995
  104.  
  105. Added time and date to the "connect" and "idle" messages produced by
  106. the -v option on sfspeaker.
  107.  
  108. 21 September 1995
  109.  
  110. Installed the ability to automatically generate, encrypt with PGP, and
  111. transmit a session key to the receiving machine.  Since PGP is invoked
  112. to encrypt and decrypt the key, Speak Freely remains free of any RSA
  113. patent issues; the user simply obtains and installs the correct
  114. version of PGP and Speak Freely automatically provides public key
  115. support compatible with PGP.  To encrypt sound to one or more people
  116. with a public key, use the:
  117.  
  118.     -z"user1 user2..."
  119.  
  120. option on sfmike.  The user names are the same as you specify on the
  121. PGP command line when encrypting files.
  122.  
  123. On the receiving end, when a PGP-encrypted session key is received,
  124. PGP is invoked to decrypt it.  Decryption requires your RSA private
  125. key, for which the pass phrase must be provided.  By default, PGP
  126. asks you for the pass phrase each time a session is initiated.  You
  127. can override this by specifying the pass phrase using the PGPPASS
  128. environment variable (see the PGP documentation for details and a
  129. discussion of the vulnerability this may create) or by using the
  130.  
  131.     -z"Pass phrase"
  132.  
  133. option on speaker.  The given pass phrase is then passed to PGP with
  134. its own -z option each time it is invoked.
  135.  
  136. 23 September 1995
  137.  
  138. Sfmike didn't accept numeric IP addresses--only resolvable host names.
  139. Fixed to call inet_addr then only try gethostbyname() if it fails.
  140.  
  141. Mike.c and speaker.c printed IP addresses the hard way.  I changed
  142. them to use inet_ntoa.
  143.  
  144. Speaker.c failed to reload the loop variable used when searching for
  145. an active connection at the start of each search.  This could lead
  146. to segmentation faults after connections had been closed. Fixed.
  147.  
  148. Connections kept around to preserve their PGP session keys caused the
  149. 10 second timer not to be canceled after all connections have gone
  150. idle.  Fixed.
  151.  
  152. Support for half-duplex audio devices.  If HALF_DUPLEX is defined
  153. at compile time, sfmike sends the copy of sfspeaker running on the
  154. local host a pair of fHalfDuplex messages with the fHalfDuplexMute and
  155. fHalfDuplexResume bits set.  On receiving a fHalfDuplexMute, sfspeaker
  156. closes the audio device, if open, and sets a flag which causes all
  157. audio input to be discarded.  When fHalfDuplexResume is received,
  158. audio input is enabled, to be acquired upon receipt of the next sound
  159. buffer.
  160.  
  161. Integrated fixes from Andrey A. Chernov to allow compiling for
  162. FreeBSD, using its Sun-like /dev/audio device.
  163.  
  164. 24 September 1995
  165.  
  166. First cut at IP Multicast support.  Multicast support is included only
  167. if IP_ADD_MEMBERSHIP is defined at compile time; we assume that it
  168. will be defined only on system with mrouted.  If multicast is present,
  169. sfspeaker recognises the "-Mhost/ip" option to indicate one or more
  170. Multicast groups to which it should add membership.  Sound packets
  171. from any of the named multicast groups as well as those sent directly
  172. to the bound port will be played.
  173.  
  174. On the sfmike side, multicast thresholds can be specified by an
  175. integer after the multicast group name or IP number, delimited by a
  176. slash.  To transmit to a continent-wide multicast group you might use
  177. the command:
  178.  
  179.     sfmike 230.1.217.11/128
  180.  
  181. Users who fret over the security risks inherent in the PGPPASS or
  182. -z"Pass phrase" method of supplying the pass phrase to PGP but can't
  183. stand having to enter the pass phrase for every new session key now
  184. have a new option.  If you specify "-z" with no pass phrase on the
  185. call to speaker, it prompts you for the pass phrase once at the start
  186. of execution, then supplies that phrase to PGP for all subsequent
  187. connections.  Note however that the pass phrase is passed to PGP with
  188. its -z option, so whatever risk that creates remains present.
  189.  
  190. Renamed "one-time pad" to "key file" and included a note about its
  191. cryptographic shortcomings in the manual page.
  192.  
  193. 25 September 1995
  194.  
  195. More fixes from Andrey A. Chernov for FreeBSD--the include of
  196. sys/timeb.hin netfone.h was conditioned on "sun" not "BSD_like",
  197. soundflush() in soundbyte.c needed to use a read() loop and test
  198. EAGAIN rather than the Sun-specific FIONREAD ioctl(), and debug output
  199. from mike.c looks better if cbreak() mode is used rather than raw().
  200.  
  201. 5 October 1995
  202.  
  203. Added debug mode output to sfspeaker to indicate when it's off
  204. calling PGP to decode a session key and whether the process
  205. succeeded or failed.  The long pauses were disturbing when you
  206. didn't know what was going on.
  207.  
  208. 6 October 1995
  209.  
  210. Added the mellifluous new ring.au to the standard release.
  211.  
  212. Feature release 5.3.
  213.  
  214. 15 October 1995
  215.  
  216. Added the "-Pport" option to speaker.c to specify which port it
  217. listens on.  If specified, this overrides the INTERNET_PORT defined in
  218. the Makefile.
  219.  
  220. Allowed specification of the port mike.c transmits to as a number
  221. appended to the hostname or IP address, delimited by a colon.  The
  222. port, if specified, must appear before any multicast scope
  223. specification.  Thus, a multicast address with port and scope
  224. specified would appear like:
  225.  
  226.         227.11.133.51:5050/64
  227.  
  228. 5 November 1995
  229.  
  230. Finished implementation of Look Who's Listening, with changes in
  231. speaker.c to notify the server, and new modules lwld.c (the server)
  232. and lwl.c (the client).  The manual pages have been split up into a
  233. separate page for each program.
  234.  
  235. Disabled all of the RTP support except that needed for Look Who's
  236. Listening.  It isn't ready for prime time, and there's no reason to
  237. delay LWL, which everybody is screaming for, to wait for it.
  238.  
  239. 6 November 1995
  240.  
  241. Added support for the LPC compression mode (-lpc) included in the RTP
  242. spec.  It's tricky to set up, since any clipping of audio drives it
  243. absolutely nuts, but 12-to-1 compression is worth the bother if you
  244. have a slow link.  You can enable -lpc and -c at the same time, but
  245. the result is so poor it's not worth trying.
  246.  
  247. 7 November 1995
  248.  
  249. Added an -n option to speaker.c which causes it to ignore any ring
  250. requests from remote hosts.  This is for Sun users who've hooked a
  251. good sound system up to the audio output jack and get irritated when a
  252. remote ring switches it back to the built-in speaker.
  253.  
  254. Feature release 5.5.
  255.  
  256. 19 November 1995
  257.  
  258. Integrated fixes for various warning messages from GCC 2.7.0 for
  259. Solaris reported by Mark B. Hamby.  Two of these were legitimate bugs
  260. in lwl.c and lwld.c, but would actually cause a problem only in the
  261. extremely unlikely circumstance of malloc() failing on the allocation
  262. of a small buffer.  The rest were just complaints about failure to
  263. cast pointers to the (char *) defined for some of the socket calls.
  264.  
  265. I created a new "contrib" directory for third party software that
  266. is not directly integrated into Speak Freely.  The first item is
  267. "tkshell", a Tcl/Tk/Tix interface to Speak Freely, also developed
  268. by Mark Hamby.
  269.  
  270. Sfspeaker showed connect and idle messages even if the "-v" option
  271. was not present.  Fixed.
  272.  
  273. Some of the cases in mike.c where a user tried to specify more than
  274. one of the compression modes -F, -LPC, and -T didn't exit after
  275. printing the error message.  This resulted in the program trying to
  276. actually use more than one of these modes at once, which could
  277. heroically mess things up.  Fixed.
  278.  
  279. Added a gimmick to make it easier to reply to a host that's just
  280. connected to your machine, avoiding all the fumble-fingered typing or
  281. furious cutting and pasting.  If you specify the
  282.  
  283.     -a"filename[ command ...]"
  284.  
  285. option to sfspeaker, every time a new host connects, it will write
  286. an executable shell script that invokes sfmike to reply to the
  287. just-connected host.  If no command is given, "sfmike -t $* hostname"
  288. is used, the $* allowing the user to pass options from the call on
  289. the reply script to sfmike.  A custom command can be specified following
  290. the filename, separated by a space (be sure to quote the string in
  291. this case).
  292.  
  293. 21 November 1995
  294.  
  295. Discovered bad htonl() logic in loop-back code in sfspeaker.  The
  296. length passed to sendto() had already been byte swapped.  Fixed.
  297.  
  298. 24 November 1995
  299.  
  300. Made GSM (-t) compression the default in mike.c.  Far, far, too many
  301. people are choosing improper compression modes, so I've made GSM the
  302. default for both the Unix and Windows versions.  The mutually
  303. exclusive compression modes (ADPCM, LPC, and GSM) now simply cancel
  304. a previously selected mode radio-button style rather than give an
  305. error message.  This preserves compatibility with earlier versions
  306. which allowed "sfmike -f", for example, without requiring an -n
  307. switch to turn off GSM.
  308.  
  309. Converted speaker.c from alarm() to setitimer(), allowing timer
  310. resolution as fine as permitted by the system clock, with
  311. specification in microseconds.  A wrapper called ularm() which accepts
  312. an argument in microseconds hides the ugliness of setitimer().  This
  313. will allow the rapid-fire time-based event generation needed to
  314. download face files from a remote server.  This, of course, required
  315. little fixes all over the place.
  316.  
  317. Discovered that going from idle to audio output active state in
  318. speaker.c didn't speed up the timeout interval to the active rate
  319. until the next timeout occurred.  Fixed to speed up the timer at the
  320. moment audio output is opened.
  321.  
  322. Renamed netfone.h to speakfree.h, eliminating the last vestige of the
  323. program's original identity.
  324.  
  325. 26 November 1995
  326.  
  327. Fixed a format in lwld.c that caused an incorrect error message
  328. when the -m message file couldn't be opened.
  329.  
  330. Integrated the "show your face" code to permit users to see each
  331. other's pictures.  A user can make a face image available by creating
  332. a 256 colour Microsoft .BMP format file and providing its pathname to
  333. sfspeaker on a SPEAKFREE_FACE environment variable.  When sound is
  334. received from a new host, sfspeaker sends a request for a face image
  335. to it.  If an image is available, is is transferred in packets at a
  336. rate configured by FaceFetchInterval in speakfree.h (in microseconds),
  337. and when complete, displayed using "xv" (which must be installed and
  338. accessible from the user's PATH).  Actually, as long as the two
  339. communicating systems are Unix, any image format displayable by xv can
  340. be used, but since the Windows version only knows how to display .BMP
  341. files, even Unix users should restrict themselves to that format.  (I
  342. may add code to enforce this in the future.)
  343.  
  344. The somewhat radical changes in timeout logic required to support
  345. transmission of the face image in the background ran afoul of the
  346. sneaky way we were keeping timed out connections around to avoid
  347. forgetting their PGP session keys.  Now a con_timeout value of -1
  348. indicates a ghost of a former connection, not (hosttimeout + 1), which
  349. can't be guaranteed with variable timer resolution.  I changed the
  350. "Tick..." message generated when the -d option is set to show the
  351. current timer interval.
  352.  
  353. Forking processes to view face images with xv was incrementing
  354. reference counts of resources inherited by the child process.  On
  355. Sun, this locked up the exclusive use /dev/audio file until all the
  356. viewer processes terminated.  I added code to release all resources
  357. inherited from the parent as soon as the child process receives
  358. control.  Audio output, if open, is unconditionally closed before
  359. the fork() since we don't know the nature of the resource(s) it may
  360. bequeath to the child process.  It will simply be reacquired when the
  361. next packet arrives.
  362.  
  363. 28 November 1995
  364.  
  365. Eliminated an unreferenced variable in the HDX_DEBUG code in
  366. speaker.c.
  367.  
  368. Changed speaker.c -d option output to show the hostname from the
  369. connection (obtained with gethostbyname) rather than the often
  370. truncated and untrustworthy hostname in the sound buffer.  If the
  371. hostname could not be obtained, the IP address is shown.
  372.  
  373. To aid in diagnosing the problems of users who connect with
  374. inappropriate compression modes, I added a status message to the
  375. -v option output which identifies the type of compression currently
  376. being used by a connected host.  The message is reissued every time
  377. the compression mode changes.
  378.  
  379. Changed the logic of the "show your face" code to make it fully
  380. downward compatible with earlier releases.  If SPEAKFREE_FACE is
  381. defined and points to a valid file, mike.c now includes a new
  382. fFaceOffer bit in every sound packet it sends.  speaker.c only
  383. requests a face from the remote host if that host's packet includes
  384. the fFaceOffer bit.  Since prior releases won't ever set that bit,
  385. there's no need to worry about them getting befuddled by receiving
  386. face requests they don't know how to process.
  387.  
  388. 30 November 1995
  389.  
  390. Integrated a fix from Hans Werner Strube which corrects the problem
  391. sending sound files on Solaris.  Due to confusion resulting from the
  392. change-over from the BSD ftime() function which returns time as
  393. seconds and milliseconds to the System V gettimeofday() which returns
  394. seconds and microseconds, the delays computed to wait for the
  395. transmission of sound buffers were 1000 times too long, resulting in a
  396. long pause between each packet.  Fixed.
  397.  
  398. Increased the default host timeout from 1 to 3 minutes.  Connections
  399. would frequently time out during long rants by the local user,
  400. requiring retransmission of the face file.  This should ameliorate
  401. the problem for the time being, pending a longer-term fix based
  402. on RTP BYE packet handshaking.
  403.  
  404. 1 December 1995
  405.  
  406. Integrated a Solaris fix from Hans Werner Strube into mike.c and
  407. soundbyte.c which sets the audio input buffer to the actual packet
  408. size currently in use.  This reduces the delay compared to the
  409. previous fixed packet size of 4000 samples.  The actual buffer size
  410. may be rounded down to the nearest multiple of 16 on machines which
  411. use the DBRI device.
  412.  
  413. Feature release 5.6.
  414.  
  415. 2 December 1995
  416.  
  417. Added a fix for FreeBSD from Andrey A. Chernov to add a required
  418. library to the FreeBSD link command.  His other fix, to comment out
  419. the compiler-busting warning in RTPOUT.C since GCC requires correct
  420. syntax even in #ifdef disabled code was already in 5.6, thanks to GCC
  421. users on Solaris who encountered the same problem.
  422.  
  423. 4 December 1995
  424.  
  425. Hans Werner Strube supplied another Solaris / System V fix required
  426. for the viewerterm() function in speaker.c.  The wait3() function
  427. present in BSD and SGI IRIX is supplanted by waitpid() in System V. As
  428. integrated, waitpid() is currently used only on Solaris.  When I get
  429. time to do more testing, I may change the code to use it
  430. unconditionally, as even SunOS 4.1.1 seems to implement it.
  431.  
  432. 5 December 1995
  433.  
  434. Our clever decision to not initialise the socket until after
  435. processing the command line options in speaker.c (so that -u works
  436. even if another copy of sfspeaker is running) ran afoul of the need
  437. for the -M option (possibly several -M options) to have the socket
  438. initialised in order to add multicast group memberships.  I moved the
  439. socket initialisation back to before the option processing loop.
  440. (Reported by Robert Kaempf).
  441.  
  442. Added a first-pass option processing loop before the socket is
  443. initialised to restore the ability to use -u when another copy of
  444. sfspeaker is running and, more importantly, allow the -p option to
  445. change the port number before the socket is bound.
  446.  
  447. 8 December 1995
  448.  
  449. Andrey A. Chernov discovered that lwl.c and lwld.c still contained
  450. numerous assumptions about both byte order and the layout of bit
  451. fields (used in the header of the RTP- compatible packets those
  452. programs exchange).  I installed the bit-twiddling version of the
  453. packet processing from the Windows version, leaving in the original
  454. code, disabled with #ifdef RationalWorld, since it documents what
  455. we're trying to accomplish a lot more clearly.  The fixed code works
  456. fine on big-endian machines, but I haven't been able to test it on a
  457. little-endian myself, so it's probable I may have missed one or more
  458. additional fixes that may be required.
  459.  
  460. Given the generally ratty state of sflwl (runs for a week without
  461. a hitch, then crashes 3 times in one day for no apparent reason),
  462. I added a bunch of new debug output when the -v option is selected
  463. including logging of all requests to the server.  Maybe this will
  464. provide some clues as to what's going on.
  465.  
  466. 9 December 1995
  467.  
  468. Integrated fixes to the Makefile and soundbyte.c which enable the
  469. program to build and run on Linux.
  470.  
  471. 19 December 1995
  472.  
  473. Well, the earlier fixes to lwl.c and lwld.c improved (or at least
  474. changed) the results of trying to run sflwl on FreeBSD, but it still
  475. doesn't work right.  Still flying blind, I took another close look at
  476. lwl.c and lwld.c and found two places in each where, under certain
  477. circumstances, a compiler treating "char" as signed might lead to
  478. trouble.  I added defensive ANDs with 0xFF in both cases.  We'll see
  479. if that does it.
  480.  
  481. Found one more little-endian problem in lwl.c--this time it was a
  482. reference to a bit field in the RTP packet which caused sflwl to
  483. mis-count the number of items returned from sflwld.  Fixed.
  484.  
  485. While sflwld detected packet overflow and flagged it to the
  486. requestor, it didn't actually stop filling the packet.  Fixed.
  487.  
  488. Including sys/wait.h pulled in signal.h before _BSD_SIGNALS was
  489. defined on the SGI, leading to naughty System V-like behaviour
  490. complete with sflwld crashing with "Alarm clock" since it failed
  491. to re-enable SIGALRM in release().  For good measure (and to
  492. preempt other System V problems), I both defined _BSD_SIGNALS at the
  493. top of the includes and included a re-enable of SIGALRM in release().
  494.  
  495. Distinguished the new debug output added yesterday from the regular
  496. sysadmin-level logging by enabling the former by the "-vv" option
  497. (very verbose) and the latter by "-v".  Detailed output (-vv)
  498. always enables the regular verbose messages.
  499.  
  500. Integrated the first-cut Hewlett-Packard audio driver code submitted
  501. by Marc Kilian.  Marc notes that this code has not been extensively
  502. tested.  It's up to you, HP workstation users, to wring this out and
  503. bring HP into the list of fully-supported platforms.  You can enable
  504. debug output by uncommenting the #define HP_DEBUG at the top of
  505. hp_audio.c.
  506.  
  507. 20 December 1995
  508.  
  509. Fixed a few more byte-order and bitfield problems, this time in
  510. rtpout.c.
  511.  
  512. Added some additional information to the "very verbose" trace from
  513. sflwld when -vv is specified, including the SDES of any SDES or
  514. BYE packet and the 4 letter code of APP messages.
  515.  
  516. 21 December 1995
  517.  
  518. Oops--missed a FreeBSD fix in the Makefile.  It's in there now.
  519.  
  520. As suggested by John Deters, I added an explicit "+armor=off"
  521. specification to the command lines used to invoke PGP in mike.c and
  522. speaker.c.  Our use of PGP to exchange a random session key requires
  523. PGP to produce a binary output file, not an ASCII armoured one, as it
  524. usually does unless the "a" option is specified.  The user can,
  525. however, make ASCII armour the default by setting the "Armor=on"
  526. option in the config.txt file; doing so caused Speak Freely's use of
  527. PGP to fail.  Configuring armor off on the command line overrides the
  528. config.txt specification and prevents this problem.
  529.  
  530. 27 December 1995
  531.  
  532. Edward Olszewski reported that the "cc" compiler on HPUX 9.05 (HP 9000
  533. 735/125) (like SunOS cc) couldn't handle the "const" modifier in the
  534. argument declarations in md5/md5.c.  To avoid an ever-growing
  535. exception list, I just removed the "const".  It won't make any
  536. difference in operation.
  537.  
  538. In addition, random() (referenced in lpc/lpc.c) was undefined in the
  539. link.  I modified lpc.c to enable the emulation of random() with
  540. lrand48 for HEWLETT_PACKARD as well as Solaris.
  541.  
  542. 31 December 1995
  543.  
  544. On some systems (Silicon Graphics, for instance) if the sfspeaker
  545. timer happens to expire while we're waiting for the fread() from
  546. the PGP session key decode pipe to complete (this usually happens
  547. when it takes the user longer to enter the secret key pass phrase 
  548. than the interval to the next timer tick), the fread() can return
  549. with zero bytes read and errno set to EINTR (Interrupted system call).
  550. I modified to the logic that reads from the PGP decode pipe in
  551. speaker.c to detect this condition and re-issue the fread() until
  552. it either succeeds or fails with a status other than EINTR.
  553.  
  554. 4 January 1996
  555.  
  556. Finished first cut of sfecho (echo.c), a remote echo server intended
  557. to allow users, even those with half-duplex audio hardware, to perform
  558. remote "sound checks" of various compression and encryption modes
  559. without the need for an individual on the other end to evaluate sound
  560. quality.  The server simply time stamps sound packets as they arrive,
  561. then sends them back to the originating address ten seconds later.
  562. No audio I/O is performed, so the echo server can be run on a machine
  563. without audio capability.
  564.  
  565. 5 January 1996
  566.  
  567. The microsecond-resolution packet timing in echo.c will overflow a
  568. long and go negative in less than an hour.  The way the code was
  569. structured, this actually didn't cause any trouble unless a packet
  570. happened to be queued right at the time the wrap-around caused the
  571. sign to change.  I modified the code to use a double for the packet
  572. time to make sure there's no wrap-around.
  573.  
  574. I changed the logic in makeSessionKey() in echo.c to use only MD5, not
  575. idearand(), to construct the RTP SDES sent to the LWL server.  Since
  576. there's no other reason to include IDEA in sfecho, eliminating this
  577. one reference gets rid of the whole IDEA patent disclaimer on the
  578. sfecho.1 manual page.
  579.  
  580. The logic in echo.c is perfectly capable of supporting a face image
  581. file for the echo server, for which I was originally planning to use
  582. an image of a statue of the Greek goddess Echo.  Well, not only
  583. haven't I been able to locate such an image, on reflection (hee, hee)
  584. I've decided that giving the echo server a face is a bad idea,
  585. especially for a widely-used public server running on a line with
  586. limited bandwidth.  It would be very easy for the volume of face data
  587. sent to all accessors to dwarf the sound packet bandwidth, inducing
  588. pauses and lost data that gave echo server users a false impression of
  589. the actual response.  Not being one to ever actually delete working
  590. code, I turned off the echo face capability with #ifdefs on ECHO_FACE
  591. so it can be restored if future events prove that to be wise.
  592.  
  593. 8 January 1996
  594.  
  595. The echo server program, echo.c, inherited logic from speaker.c to
  596. disable publication of its identity on the SPEAKFREE_LWL_TELL server
  597. if a connection is refused.  This is intended to keep machines which
  598. once ran an LWL server but don't any more from being repeatedly
  599. bombarded with LWL packets.  Unfortunately, this means that if an LWL
  600. server is momentarily out of service, the echo server will disappear
  601. from the LWL directory until it restarts the next time; this is bad.
  602. So, I removed the disabling due to connection refused in echo.c,
  603. trusting the administrator of an echo server to be responsible enough
  604. to respond to the repeated warning messages for refused connections
  605. when an LWL server is genuinely rather than transiently down.
  606.  
  607. In an attempt to fix the sporadic "broken pipe" crashes of the sflwld
  608. server (every three or four days on the SGI, typically), I'm
  609. proceeding on the hypothesis that this happens when a user submits a
  610. request and then shuts down (or crashes) before we write the reply
  611. back to the socket.  (I have not, however, even with a deliberately
  612. broken version of sflwl, been able to make this happen.)  Anyway, I
  613. added a SIGPIPE signal catcher which ignores the signal (at the
  614. moment, printing a message when this happens).  This should allow the
  615. send() to return and the connection to be closed normally.  There's
  616. nothing else we can do about it anyway.
  617.  
  618. 10 January 1996
  619.  
  620. The critical section locking code in echo.c wasn't entirely
  621. bulletproof against a host timeout occurring while processing a sound
  622. packet from that host, or while scanning the connection chain and/or
  623. making an entry for a new host.  I revised the logic to include all
  624. references to the connection chain as well as the queued packet list
  625. within the critical section that blocks the timer interrupt.  In
  626. addition, I revised the detection of host timeouts and LWL
  627. retransmissions in release() to be based on absolute time rather than
  628. a countdown timeout.  This permits release() to be called at any time
  629. whatsoever without worrying about whether the proper timeout interval
  630. has elapsed and, hence, to be called whenever the critical section
  631. lock is released if the timeout has expired while the lock was set.
  632. This timeout logic is a lot cleaner and deserves to be integrated into
  633. speaker.c once it's proven in the more demanding environment (due to
  634. rapid-fire packet timing interrupts) of echo.c.
  635.  
  636. 21 January 1996
  637.  
  638. Added a hexadecimal dump (-x) option to sfspeaker if it's
  639. compiled with HEXDUMP defined.  One more little tool to help
  640. debug RTP and VAT support.
  641.  
  642. Found a place in speaker.c's LPC decompression function 
  643. lpcdecomp() where an ntohl() was needed in extracting the
  644. decompressed length of the message.
  645.  
  646. 28 January 1996
  647.  
  648. Staked another bloodsucking byte-order dependency in lpccomp() in
  649. mike.c.
  650.  
  651. Added a reality-check in playbuffer() in speaker.c which discards
  652. packets with a buffer.buffer_len field longer than the actual packet
  653. read from the socket.  This prevents embarrassing blasts of noise or
  654. worse if we receive a garbage packet due to improper protocol
  655. recognition or an incorrect encryption key on an RTP or VAT
  656. connection.
  657.  
  658. Playbuffer() in speaker.c made a redundant test on showhosts.  Fixed.
  659.  
  660. Added monitoring of the control port (data port + 1) to speaker.c to
  661. recognise VAT and RTP connections.  A new con_protocol field in the
  662. connection structure indicates the protocol of the connection.  The
  663. reply command will now contain the sfmike appropriate option to send
  664. in the protocol we're receiving.
  665.  
  666. 29 January 1996
  667.  
  668. Integrated a decode-only version of Dave Hawkes' VOX compression mode.
  669. I'm not close to being able to make the compressor available, but at
  670. least this this code in place, Unix users can receive packets sent by
  671. the Windows version with this compression mode.  All the encoding
  672. logic is present in the module VOX.C, but disabled pending
  673. integration.
  674.  
  675. Made innumerable fixes in the VAT and RTP support code and associated
  676. packet translators.  For the moment, everything is pretty much working
  677. except for LPC; neither NEVOT nor VAT seem to be able to talk to one
  678. another in LPC mode so I'm not sure the problem is of my making.  GSM
  679. and all the other common modes work fine.  It's a little odd that VAT
  680. ID and RTP SDES packets are sent by sfmike as well as sfspeaker; to be
  681. marked as a participant in a conference you have to run sfmike with
  682. its ID (though you do not have to actually transmit anything).  I may
  683. change this, but for the moment getting this logic into the Windows
  684. version (which does not share our schizophrenic view of connections)
  685. is a much higher priority.
  686.  
  687. 31 January 1996
  688.  
  689. The "plumber()" code in lwld.c that catches SIGPIPE signals when a
  690. remote user disconnects while we're tring to send the reply to a query
  691. seems to be working well.  So, to tempt fate, I disabled the log
  692. message when we recover from a SIGPIPE.
  693.  
  694. After struggling 2 days trying to figure out why I could receive
  695. LPC-encoded sound just fine from VAT, and send it to myself with no
  696. trouble in LPC format, but was unable to send LPC sound to VAT, I
  697. decided to download a newer VAT.  I got the 4.0a2 alpha release, and
  698. no trouble with LPC in either direction.  I guess it just didn't work
  699. in earlier versions of VAT.
  700.  
  701. To avoid confusing those familiar with VAT, mike.c now parses
  702. destinations in any of the following formats:
  703.  
  704.     hostname
  705.     hostname:port
  706.     hostname/port
  707.     hostname:port/ttl
  708.     hostname/port/ttl
  709.  
  710. Integrated DES encryption code into the VAT and RTP output handlers
  711. in mike.c.  Like everything else in the funhouse of VAT and RTP,
  712. results are mixed.  Clearly VAT and I agree on key generation, since
  713. the sound I send is played OK, but with ticking between each
  714. packet in GSM mode, indicating VAT doesn't handle the padding of
  715. packets to 8 bytes correctly.  Well, thank goodness RTP introduced
  716. the "P" flag!  But NEVOT doesn't seem to recognise any DES encrypted
  717. inbound packets in RTP mode!  So, let's try the new VAT--uhhhh, it
  718. appears they've totally pulled DES support from it due to "export
  719. control" restrictions.  Gosh this is fun.
  720.  
  721. 1 February 1996
  722.  
  723. After several more hours of psychoanalysis of the RTP spec and
  724. examination of the VAT and RTP source code, DES encryption of RTP
  725. packets works in both directions when I test with NeVoT 3.32.  I can't
  726. test RTP encryption with VAT 4.0.a2 alpha since they've disabled
  727. encryption due to ITAR fears.  At present, I assume that if RTP
  728. encryption is enabled, both control and data packets will be
  729. encrypted, and this is how NeVoT behaves.  RTP allows RTCP control
  730. channel packets to be either encrypted or in the clear--you're
  731. supposed to detect a clear packet by verifying that it meets 
  732. rather easy-to-spoof consistency conditions.  This gives me the
  733. willies; I'll defer such "heuristics" until things settle out more in
  734. RTP land.
  735.  
  736. With even more hacking, I can now talk to NeVoT in RTP mode both
  737. directions with DES encryption, more or less.  The less is that for
  738. some reason ADPCM picks up noise and, of course, LPC doesn't work
  739. right (but it never did, even without DES).  VAT doesn't pad packets
  740. when encrypting, and I haven't guess the golden rule that governs how
  741. the packet is initialised when it is encrypted.  (Hint: it isn't
  742. zeroed--I tried that.)
  743.  
  744. Integrated a fix from Paul Eggert for Solaris 2.5 in mike.c.  In
  745. Solaris 2.5 gettimeofday() is required to have two arguments--you have
  746. to pass an explicit NULL if you don't want the time zone information.
  747. Both references that failed to supply the NULL now do.
  748.  
  749. Removed the terminal protocol dependent modules from libdes.a to avoid
  750. nugatory incompatibilities in ports.
  751.  
  752. 2 February 1996
  753.  
  754. Modified rtp_make_sdes() and rtp_make_bye() in rtpacket.c to
  755. optionally create a composite RTCP packet with a void Receiver Report
  756. at the start if called with a new "strict" argument TRUE.  The RTP
  757. spec requires an RTCP packet to always begin with a (possibly void) SR
  758. or RR.  Why make it optional?  I had missed this little twist when I
  759. implemented lwld.c, and though I'll fix lwld.c to accept packets in
  760. this format, existing servers won't understand them until they install
  761. the updated version.  So, we'll go on sending the old format to LWL
  762. servers for a while.
  763.  
  764. "Just in case", I deleted the private items used only by the LWL
  765. server from the SDES packet if strict is set.  They're perfectly
  766. legal but, you know....
  767.  
  768. Added unconditional padding of the whole packet to a multiple of 8
  769. bytes in rtp_make_sdes() and rtp_make_bye().  Later on, we may want to
  770. encrypt these packets, and it's a lot easier to pad them at generation
  771. time when we understand the composite nature of the packets than at
  772. encryption time, when we'd prefer to treat them as a black box.
  773. Padding is done only for strict calls, for the same reasons given
  774. above.
  775.  
  776. If strict is set rtp_make_sdes() now deletes the leading asterisk (if
  777. present) from the RTCP_SDES_CNAME and RTCP_SDES_EMAIL which servers
  778. only to inform an LWL server that the user permits exact matches only
  779. of his E-mail address and doesn't wish to be listed in the HTML
  780. directory.  The asterisks could confuse an RTP client, so we don't
  781. send 'em.
  782.  
  783. Modified lwld.c so it understands packets which comply with the RTP
  784. requirement that all RTCP packets begin with an SR or RR packet.  In
  785. the future, once all the servers are running this version, we'll be
  786. able to use the same SDES packet for the LWL server and to send to RTP
  787. connections.  I also verified that lwld.c works even if the packet it
  788. receives contains padding.  Note that only the first eligible RTCP
  789. message in a packet is processed--If you stack multiple requests in
  790. one packet, only the first will be processed.
  791.  
  792. Fixed a raft of byte order and bit field order independence problems
  793. in rtpacket.c; isrtp() (this had never had the RationalWorld treatment
  794. applied to it, since it didn't make sense to uglify it before it was
  795. even working).  I also added logic to skip a header extension, if
  796. present.  Since none of the tools I have to test with ever includes a
  797. header extension, I can't be absolutely sure I've got this right.
  798.  
  799. Added a new isValidRTCPpacket() function to rtpacket.c, based on the
  800. validation technique suggested in the RTP spec.  This is now called
  801. in speaker.c for two purposes.  First, the protocol of a connection is
  802. set to RTP only when a valid RTCP message is received rather than for
  803. any control message with a version of 2.  This makes it much less
  804. likely the protocol will get set to RTP accidentally by an encrypted
  805. VAT control message that we don't have the key to properly decode.
  806. Second, if a DES key is supplied and we receive a message on the
  807. control channel which passes all the tests for RTCP validity as
  808. received, we don't decrypt it.  This allows RTP programs to either
  809. send control messages in the clear or encrypt them; both behaviours
  810. are permitted by the RTP spec.
  811.  
  812. Fixed mike.c to encrypt RTCP BYE and VAT DONE packets when encryption
  813. is enabled.  NeVoT accepts the encrypted packets with no difficulty.
  814.  
  815. Moved the generation of VAT DONE packets from in-line code in mike.c
  816. to a new makevatdone() function in vatpkt.c both for purity of essence
  817. and to make it easier to move the code to Windows.
  818.  
  819. Fixed an oddity that caused VAT 4 not to recognise a DONE packet in
  820. the form that was sent by VAT 3.  I copied the VAT 3 packet, but
  821. apparently it had garbage bits in the flags field that VAT 4 didn't
  822. like.  I zeroed the flags field and all was well.
  823.  
  824. Modified makeVATid() in vatpkt.c to take the E-mail address from the
  825. SPEAKFREE_ID variable if no SPEAKFREE_CNAME is specified.  If neither
  826. is present, an ID is made up from the password file information as
  827. before.
  828.  
  829. Fixed makeVATid() in vatpkt.c to delete leading asterisks on the
  830. SPEAKFREE_CNAME and SPEAKFREE_ID E-mail addresses just like rtpacket.c
  831. does.
  832.  
  833. Added logic in mike.c and rtpacket.c to set the marker (M) bit in the
  834. RTP packet header for the first packet of a "talk spurt".  This
  835. conforms to the behaviour of VAT 4 in RTP mode.
  836.  
  837. Added documentation of the -rtp and -vat options to the sfmike.1
  838. manual page.
  839.  
  840. Implemented a major revision of the "squelch" (a.k.a. VOX) code in
  841. mike.c.  While still nothing close to as nifty as Dave Hawkes' VOX
  842. code in the Windows version, this is a great improvement over the
  843. pathetic attempt at VOX that preceded it.  This version tests the
  844. maximum energy in a packet in the linear domain, not the logarithmic
  845. (which, notwithstanding psychoacoustics, our users understand much
  846. more clearly), and allows you to specify as a second comma-separated
  847. argument to the -s option, the time in milliseconds transmission
  848. should continue before muting transmission.  In addition, the push to
  849. talk console display now shows "Quiet:" when Talk mode is enabled and
  850. output is squelched.
  851.  
  852. 3 February 1996
  853.  
  854. Added the capability to echo VAT and RTP packets to sfecho.  This
  855. involved having echo.c monitor both control and data sockets as
  856. sfspeaker does, and return packets received to the same port from
  857. which they originated.  The (soon to be remedied) potential ambiguity
  858. between Speak Freely and VAT packets means uncompressed VAT packets
  859. can be mistaken for Speak Freely sound buffers.  We only consider a
  860. packet as VAT if we've previously received a message on the control
  861. port from this connection, and if it is in an audio format we know VAT
  862. to use.  Note that mistaking the format of a packet only affects the
  863. log messages generated when the -v option is on; since packets are
  864. bodily returned to the originator without examining their content, the
  865. actual echo process does not require recognition of packet format,
  866.  
  867. Handling VAT and RTP packets without peeking inside made it impossible
  868. to maintain the (already disabled for other good reasons) echo
  869. server's ability to show a face file.  I ripped out all the code for
  870. that potential but ill-considered feature.
  871.  
  872. To avoid potential confusion between Speak Freely sound buffers and
  873. VAT packets, I modified packet generation code everywhere to always
  874. set the new fProtocol (0x40000000) bit in the compression field of
  875. every sound buffer we send.  This won't interfere with older versions
  876. of Speak Freely, but will keep VAT compatible programs from attempting
  877. to interpret Speak Freely packets as VAT format.  (The protocol flag
  878. turns into a VAT/RTP P value of 1, which was used by the now-obsolete
  879. first draft of RTP. We should never see it sent by a current program.)
  880. Once all versions of Speak Freely are sending the fProtocol bit, we'll
  881. be able to increase our own level of discrimination between VAT and
  882. Speak Freely packets.
  883.  
  884. Implemented another major turn of the screw to avoid spoofing by
  885. improperly decrypted packets.  RTP and VAT sound packets are now
  886. accepted only if the session ID (conference ID for VAT, SSRC for
  887. RTP) received in the last control message for this protocol agrees
  888. with that contained in the sound packet.  This makes it vastly less
  889. likely we'll be fooled again by a Speak Freely sound buffer after a
  890. protocol change or a message we can't decrypt.
  891.  
  892. To avoid incorrectly decrypted VAT and RTP packets from being
  893. interpreted as Speak Freely sound buffers, I added a check in
  894. speaker.c that verifies the length in the buffer.buffer_len field
  895. against the actual length of the packet read from the socket (this
  896. must take into account the padding to a multiple of 8 bytes which
  897. occurs if DES, IDEA, or PGP encryption is indicated by the flags in
  898. the header).  This is a pretty good test for validity, since the odds
  899. of 4 encrypted bytes precisely equalling the received packet length
  900. are very slim.  If a bogus packet is detected, it is ignored and the
  901. protocol for the connection reset to PROTOCOL_UNKNOWN, which allows us
  902. to restart protocol recognition.  This, in turn, permits us to
  903. identify unencrypted Speak Freely sound buffers which may arrive,
  904. unless we're reset to VAT or RTP modes by the subsequent arrival of a
  905. packet on the control port.
  906.  
  907. 4 February 1996
  908.  
  909. The code which inserts a 4 random bytes before an RTCP message that's
  910. being encrypted in sendrtpctrl() in mike.c was broken, and didn't test
  911. whether the message was VAT (which doesn't have the random prefix) or
  912. RTP.  Fixed.
  913.  
  914. In the process of testing the above fix, I discovered that the
  915. generation of SDES and BYE packets in rtpacket.c must actually pad
  916. packets to an *odd* multiple of 4 bytes.  Why?  Because the length
  917. of the block to be encrypted needs to be a multiple of 8 bytes, and
  918. that includes the 4 byte random prefix.  So the original packet needs
  919. to be an odd multiple of 4.
  920.  
  921. Just a note in passing: the DES encryption used with VAT and RTP is
  922. standard DES including the initial and final permutations which Speak
  923. Freely dispenses with in its own modified DES.  This slows down the
  924. encryption and decryption process quite a bit (which is precisely what
  925. it's intended to do, of course), but we have no choice since that's
  926. what the RTP spec and VAT software require.
  927.  
  928. Padding of RTP sound packets when encrypting with DES was wrong.
  929. Fixed.
  930.  
  931. Shuffling the pad byte to the end of the frame for LPC compressed
  932. sound in rtpout() (rtpacket.c) wasn't quite right.  Fixed.  While I
  933. was at it, I modified isrtp() to do the inverse byte shuffle rather
  934. than call lpc_analyze() to decompress the sound.  This also fixes
  935. sfspeaker's identifying LPC compressed sound in an RTP packet as
  936. "uncompressed".
  937.  
  938. Replaced the hokey random prefix generation for DES encrypted RTCP
  939. packets used by sendrtpctrl() in mike.c with a proper set of random
  940. bytes derived from the same MD5 source used for the SSRC, timestamp,
  941. and sequence number fields.
  942.  
  943. 6.0-Alpha 1 prerelease.
  944.  
  945. 5 February 1996
  946.  
  947. Installed fixes for three problems reported by Jay Novello when
  948. building on Solaris 2.4 with gcc.  Two places in rtpacket.c I stored
  949. an unsigned value > 127 into a char.  Gcc natters at this, so I
  950. changed the variable in question into an unsigned char.  Let's see
  951. what natters this sets off elsewhere (on SunOS and SGI it compiles
  952. cleanly).  Second, in soundbyte.c, the same apparent incompatibility
  953. between stdlib.h and math.h that surfaced on SGI seems to afflict
  954. Solaris/gcc as well.  I commented out the #include of math.h and
  955. verified that doing so didn't break anything on SunOS.
  956.  
  957. Added receive-only support for RTP PCMA (payload type 8) packets.  The
  958. A-law samples are translated into mu-law samples one for one.  I
  959. haven't been able to test this since I haven't yet found a program
  960. which sends PCMA. There's no reason to support sending in this format,
  961. as minimum compliance with RFC 1890 requires support of PCMU (payload
  962. type 0), and there is no RTP channel capable of transmitting PCMA
  963. which cannot equally well transmit PCMU.  Adding PCMA inbound support
  964. checks off another RTP payload type which we may increasingly
  965. encounter as ISDN telephony begins to interact with the Internet.
  966.  
  967. 9 February 1996
  968.  
  969. The code in speaker.c that initialises the con_session field
  970. in the connection structure thought it was 8 bytes instead of
  971. 4.  Fixed.
  972.  
  973. System V's ever-so-clever trick of blowing off pending system calls
  974. with an EINTR status when even a timer signal occurs caused horrors in
  975. in mike.c's sendfile() of which even Billy Boy would have been proud.
  976. The read (Pause mode) or poll (Talk mode) of standard input to see if
  977. we should toggle transmit can return not only when a character is
  978. available, but also when the timer pops.  Testing for -1 status
  979. doesn't work on BSD because there you get a -1 with a WOULDBLOCK errno
  980. when no character is available.  On System V, that case returns 0
  981. characters read and no error.  So, we have to test for a return status
  982. of -1 and errno == EINTR to decide we should retry the read.  A
  983. similar condition in the initial read to transition into Talk mode
  984. required wrapping that read in a loop which is broken only on
  985. non-EINTR conditions.  This fixes the "jumps into Talk mode even when
  986. I didn't press a key" and "sends a blip of sound every 7 seconds even
  987. when I'm in Quiet" bugs.
  988.  
  989. 10 February 1996
  990.  
  991. Ripped out some obsolete code in isvat.c that tried to discriminate
  992. VAT packets from Speak Freely packets by checking the consistency of
  993. the Speak Freely header.  With the determination of the protocol based
  994. on control channel messages and verification of the session ID in the
  995. packet, this is no longer necessary.
  996.  
  997. Integrated some fixes to isvat.c from the Windows version which may
  998. avoid warnings on Unix compilers pickier than those I use.
  999.  
  1000. Isvat() and isrtp() used to look at information in the connection
  1001. structure when processing the packet, but no longer do.  I removed the
  1002. unused connection argument, which makes the functions more portable
  1003. between the Unix and Windows versions.
  1004.  
  1005. 12 February 1996
  1006.  
  1007. I decided to tackle the problems of the LPC decoder head-on.  First of
  1008. all, I started with the version of LPC.C from the latest VAT source;
  1009. this version has been modified so the decoder state is kept in a
  1010. separate structure so multiple simultaneous streams don't confuse the
  1011. decoder.  I further modified it to dynamically allocate the large
  1012. static and automatic arrays used in the coder and decoder; new
  1013. functions lpc_start() and lpc_end() allocate and release the work
  1014. buffer, respectively.  The main rationale for this is that it's
  1015. necessary to keep these arrays out of the 64K data segment on 16 bit
  1016. Windows, and doing it here as well minimises differences in the code
  1017. and costs nothing.
  1018.  
  1019. To try to nail down the divide by zero and DOMAIN ERROR in sqrt()
  1020. problems, I ran various tests using standard audio test files.  First
  1021. I discovered that absolute silence (rarely encountered with a real
  1022. microphone but common in edited sound files) could cause durbin() in
  1023. lpc.c to divide by zero.  I added code to detect the incipient divide
  1024. by zero and return a zero gain value.  This fixes the problem where
  1025. true silence was rendered as hiss.  I also discovered that in certain
  1026. circumstances (probably due to roundoff of floats) the gain can go
  1027. negative by a tiny epsilon, but all it takes to make sqrt() report a
  1028. DOMAIN ERROR.  I added a test for negative gain and zero the value
  1029. before the square root is taken.  Both of these changes are enabled
  1030. only if SILENCEFIX is defined, which it is by default.
  1031.  
  1032. Given the horrors which LPC encoding results in when driven into
  1033. clipping, I added a new definition, GAIN_ADJUST, set to 0.9 by
  1034. default, which is used to scale the linearised samples before
  1035. processing.  Given that many users set their mike very hot, counting
  1036. on the other coders not to mind an occasional clip, this has the
  1037. effect of reducing the gain when encoding in LPC and avoids some of
  1038. the worst clipping.  Given that sound perception is logarithmic, I
  1039. don't think the difference will be very perceptible.
  1040.  
  1041. 13 February 1996
  1042.  
  1043. ADPCM packets sent by sfmike in RTP protocol sounded ratty due to an
  1044. error in the calculation of RTP packet length in rtpacket.c's rtpout()
  1045. function which accidentally truncated the last two samples in the
  1046. packet.  Fixed.
  1047.  
  1048. 14 February 1996
  1049.  
  1050. Added an RFC 1890 string-to-key mapping for DES encryption of RTP
  1051. packets.  The code was borrowed from a routine in NeVoT's netutil
  1052. directory.  Both mike.c and speaker.c call the new routine in deskey.c
  1053. to generate RTP encryption keys.  This new code recognises RFC 1890
  1054. encryption algorithm specifications, but only DES-CBC is accepted; any
  1055. other encryption mode exits with an error message.
  1056.  
  1057. To avoid protocol spoofing, I added code to reset the connection's
  1058. receive protocol to PROTOCOL_UNKNOWN when an RTP or VAT BYE/DONE
  1059. message is received and when any connection times out.  If the -v
  1060. option is set, RTP and VAT bye message are now logged with a
  1061. "connection closed" message.
  1062.  
  1063. My code that zeroes the pad at the end of an RTP or VAT encrypted
  1064. buffer was a little too clever--it cleared the length of the pad as
  1065. well as the pad bytes!  Fixed in speaker.c.
  1066.  
  1067. Since VAT and RTP have different conventions for converting key
  1068. strings to DES keys, I had to separate the VAT and RTP keys into
  1069. separate buffers.  This causes no trouble in mike.c, but it really
  1070. bollixes up automatic protocol sensing in speaker.c.  I added logic
  1071. which uses the correct key as long as the protocol is known.  If the
  1072. protocol is unknown or we've received an indecipherable packet, we try
  1073. the RTP and VAT keys on alternate control channel messages until we
  1074. successfully crack a packet.  Since any protocol error resets the
  1075. protocol to unknown, this should us to home in on the protocol
  1076. relatively quickly.
  1077.  
  1078. Added a general purpose RTCP SDES parser, parseSDES(), to rtpacket.c
  1079. and placed the definitions for the structures it uses in the new file
  1080. rtpacket.h.
  1081.  
  1082. If the "-v" option is specified, sfspeaker now shows the user name and
  1083. E-mail address (if available) from the identity packets received on
  1084. the control port.  The user information is updated every time it
  1085. changes.  The code does not currently handle packets with multiple
  1086. sources--only the first source in the packet is returned.
  1087.  
  1088. VAT prefers the user's long name from the password file for its
  1089. identity packets.  I modified makeVATid() in vatpkt.c to behave the
  1090. same way.
  1091.  
  1092. I increased the packet lengths for RTP and VAT protocols to the
  1093. largest sizes within both the RTP/VAT experience base and the
  1094. the 512 byte Windows packet constraint.
  1095.  
  1096. Integrated a couple of byte order fixes discovered in the Windows
  1097. version into isrtp() (rtpacket.c) and isvat() (vatpkt.c).
  1098.  
  1099. 15 February 1996
  1100.  
  1101. Added another little tweak to automatic protocol recognition of
  1102. encrypted control messages in speaker.c which should speed the
  1103. transition on a Speak Freely to RTP or VAT protocol change.
  1104.  
  1105. 16 February 1996
  1106.  
  1107. Added code in mike.c and speaker.c and modified functions
  1108. isValidRTCPpacket(), isRTCPByepacket(), and parseSDES() in rtpacket.c
  1109. to support Speak Freely session control messages.  The messages sent
  1110. and received are identical to RTP SDES packets, except the protocol is
  1111. set to 1 to indicate Speak Freely.  Speak Freely never encrypts its
  1112. session control messages, so the existing check for an unencrypted
  1113. control messages takes care of this condition.
  1114.  
  1115. Oops--forgot to enable the periodic re-send of the SDES item if
  1116. the procotol selected is Speak Freely.  Fixed.
  1117.  
  1118. 22 February 1996
  1119.  
  1120. 6.0-Alpha 2 prerelease.
  1121.  
  1122. 23 February 1996
  1123.  
  1124. Some people ran into library incompatibilities compiling files in
  1125. libdes which aren't actually used by Speak Freely.  I made a
  1126. Makefile.sf which builds only the files we need, and tweaked the
  1127. libdes/des.h file to not define crypt(), which conflicted with the
  1128. definition in unistd.h.
  1129.  
  1130. 25 February 1996
  1131.  
  1132. Added logic to echo.c to recognise RTCP BYE and VAT DONE packets and
  1133. mark the connection closed without retransmitting the packet to the
  1134. other end.  This fixes the problem where a user closes a connection to
  1135. the echo server, only to have it pop back open when his own BYE packet
  1136. comes back.  (Yes, it seems dumb to open a connection upon receipt of
  1137. a BYE packet, but it is very easy for an encrypted RTP SDES message to
  1138. look like a VAT DONE, so we have to allow an apparent VAT DONE to open
  1139. a connection.  Sigh.)  Note that this will not work if the user is
  1140. sending encrypted RTP or VAT packets to the echo server.  Receipt of a
  1141. BYE causes the host to go idle on the next timer tick without waiting
  1142. for the usual inactivity timeout.
  1143.  
  1144. Lazarus echo connections could also result if packets remained in the
  1145. retransmission queue for a given host at the time we receive a BYE
  1146. message from it.  I added code in echo.c to discard any packets queued
  1147. to a host at the time it disconnects.
  1148.  
  1149. Modified debug output from sfecho to use a slash between the IP
  1150. address and port number, as is becoming the usual convention.
  1151.  
  1152. Finished "sfvod", the "voice on demand" server.  Actually, this is
  1153. just a hack in Perl which monitors a port pair and, at each new
  1154. connection, forks a process which sends one or more sound files or
  1155. live audio to the connected site with sfmike.  If the site disconnects
  1156. before the transmission is done, sfvod detects this and kills the
  1157. sfmike process.  You can write a log in NCSA HTTPD format of all
  1158. requests processed by the server.  You can run as many copies of sfvod
  1159. as you like, each monitoring a different port, to allow users to
  1160. retrieve different audio available on a host.
  1161.  
  1162. 6.0-Alpha 3 prerelease.
  1163.  
  1164. 26 February 1996
  1165.  
  1166. Once again, it's demonstrated that not even the simplest program can
  1167. esape the wiles of BSD and System V co-consipiring to pump it full of
  1168. arcana.  Today's victime du jour is sfvod, which encountered the
  1169. following problems on System V. First of all, its socket recv() call
  1170. was getting nailed by System V's favourite trick, the EINTR error
  1171. return when the timer signal arrives.  Further, Jay Novello reported
  1172. that on Solaris 2.4 he was getting an error return from the socket at
  1173. the end of each connection with an ECHILD status.  This doesn't make
  1174. any sense according to any of the documents I have, since ECHILD isn't
  1175. a defined return status for recv(), but I put in code to ignore that
  1176. status as well as EINTR and silently retry the recv().  Next, the
  1177. timer and child process reaper signal handlers were getting clobbered
  1178. on System V because they did not re-establish the signal by
  1179. re-assigning to the %SIG variable at the end of the interrupt service
  1180. procedure.  Did you know that the semantics of signal handling in Perl
  1181. depend upon whether the platform you're running is BSD or System V? I
  1182. do now.
  1183.  
  1184. But even that was not enough.  You see, on SunOS SOCK_DGRAM is defined
  1185. as 2, while on IRIX it is 1, so the socket creation was failing since
  1186. the value of 2 I used means SOCK_STREAM on IRIX.  I added an ugly hack
  1187. to the Makefile to create an ephemeral C program which is compiled and
  1188. run to insert the system's definitions of AF_INET and SOCK_DGRAM at
  1189. the head of sfvod.
  1190.  
  1191. 27 February 1996
  1192.  
  1193. Speak Freely failed to sense VAT protocol when connected to a CU-SeeMe
  1194. reflector because Speak Freely required a user ID as received in a
  1195. point to point VAT connection, whereas the reflector sends IDLIST
  1196. (type 3) packets.  I modified the protocol sensing logic in speaker.c
  1197. to accept IDLIST packets as indicating VAT protocol.
  1198.  
  1199. The CU-SeeMe reflector's periodic status packets were confusing
  1200. isvat() in vatpkt.c into returning invalid sound buffers.  Fixed.
  1201.  
  1202. Added the ability to include a "conference ID" in VAT packets, but
  1203. since nothing seems to work if you send VAT a nonzero conference ID, I
  1204. always set it to zero at the moment.
  1205.  
  1206. With the advent of "voice on demand", the need to be able to transmit
  1207. pre-compressed audio has become apparent.  I added a gimmick to mike.c
  1208. which, if a sound file is specified with the extension ".gsm", assumes
  1209. it to be the GSM compressed output of "toast" and transmits it in GSM
  1210. packets without any additional processing.  The fact that there is no
  1211. overhead at all for these packets makes it crucial to set kOverhead
  1212. right in mike.c.  It's clear I'm going to have to put in an adaptive
  1213. auto-set mode for this tweak.
  1214.  
  1215. 28 February 1996
  1216.  
  1217. All the various compression and encryption modes, combined with the
  1218. wide range of machine performance encountered was beyond the ability
  1219. of the simple timing loop used when transmitting sound files.  I
  1220. modified it to measure the actual time between packets, compare it to
  1221. the correct inter-packet time based on the number of samples in the
  1222. packet, and correct the wait time using an exponentially smoothed
  1223. moving average with smoothing factor of 0.9.  This will, in most
  1224. cases, home in quickly on the correct delay without being upset too
  1225. much by instantaneous changes in system load.
  1226.  
  1227. The more accurate calculation of packet cadence times ran squarely
  1228. into an eccentricity of usleep() on BSD--if you call usleep() before
  1229. the previous setitimer has gone off, the nearer-term delay will apply.
  1230. This could lead to disaster when our own timeout went off.  I modified
  1231. the private copy of usleep() in usleep.c, now renamed sf_usleep(), to
  1232. behave reasonably, including stacking and unstacking preexisting
  1233. SIGALRM handlers and interval timers.  All platforms now call
  1234. sf_usleep(), eliminating the different handling of this function all
  1235. over the program.
  1236.  
  1237. Added a nicer status message when connected to a VAT conference that
  1238. shows who's in the conference and updates every time the members
  1239. change.  I increased the size of the "user name" field (con_uname) in
  1240. the connection structure in speakfree.h to accommodate longer
  1241. conference lists and protect against lists longer than the field size
  1242. overwriting the structure.
  1243.  
  1244. Integrated three fixes from Eugene Crosser in mike.c and soundbyte.c
  1245. for problems experienced on Linux and with half duplex in general:
  1246.  
  1247.     1.  In mike.c line 657, if sfspeaker is not running on the local
  1248.         host, soundinit() is not executed, causing soundrab to read
  1249.         from unopened fd.
  1250.  
  1251.     2.  In mike.c line 1195 return from main() leaves the terminal in
  1252.         noecho mode.
  1253.  
  1254.     3.  In soundbyte.c line 119 set nonblocking mode on audio is not
  1255.         executed on Linux.  Thus sfmike blocks in soundflush() on the
  1256.         second pause/talk toggle.
  1257.  
  1258. 6.0-Alpha 4 prerelease.
  1259.  
  1260. 29 February 1996
  1261.  
  1262. When sending live audio from a Solaris system, the read() from
  1263. /dev/audio in soundgrab() (soundbyte.c) could be blown away by the
  1264. timer signal.  Fixed to retry if it fails with EINTR.
  1265.  
  1266. Cleaned up the #ifdefs around the sound packet timing code in mike.c
  1267. to make the BSD_like and System V cases always mutually exclusive.
  1268.  
  1269. Sflwl could crash if "-vv" debugging was enabled and a BYE packet was
  1270. received out of the blue from host when no hosts were connected.
  1271. Fixed.
  1272.  
  1273. 1 March 1996
  1274.  
  1275. When I integrated the little-endian fixes into vatpkt.c from the
  1276. Windows version, I fat-fingered two instances, using ntohs() instead
  1277. of htons().  Since these functions are, in fact, identical on every
  1278. machine I am aware of, this worked but was unclean.  Scrubbed and
  1279. polished.
  1280.  
  1281. 5 March 1996
  1282.  
  1283. Feature release 6.0.
  1284.  
  1285. 10 March 1996
  1286.  
  1287. Revised simple (-C / 2X) compression to use the linear interpolation
  1288. rate conversion routine from "sox".  It still doesn't sound great, but
  1289. it's better than it used to be.
  1290.  
  1291. 11 March 1996
  1292.  
  1293. If the user combined key file encryption with one of the 8 byte frame
  1294. encryption methods (IDEA, PGP, or DES) and the original packet was not
  1295. a multiple of 8 bytes, the last frame would be incorrectly decrypted.
  1296. Speaker.c was not key-file decrypting the pad bytes at the end of the
  1297. packet as required by the subsequent decryptions.  Fixed.
  1298.  
  1299. Integrated the NSA LPC-10 2400 baud CODEC as an option for Speak
  1300. Freely protocol.  It's kept in a new lpc10 directory, and activated
  1301. with the "-lpc10" option on sfmike.  Note that this CODEC is entirely
  1302. unrelated to that selected by "-lpc" and cannot be used in RTP and VAT
  1303. modes because it is not one of the forms of compression prescribed for
  1304. those protocols.  Due to the extreme (better than 25 to 1) compression
  1305. of this protocol, per-packet overhead becomes a substantial part of
  1306. the bandwidth sent.  I added a dirty trick called "packet stuffing"
  1307. for use with this compression mode.  The no longer used 16 byte
  1308. "sendinghost" field actually carries the last 16 bytes of the packet.
  1309. Stuffed packets are re-shuffled upon receipt by speaker.c.  For
  1310. compatibility, stuffing is used only with the new LPC-10 compression
  1311. mode; for the other modes the 16 byte overhead is not that significant
  1312. an overhead.
  1313.  
  1314. Stuffing reduces the per-packet overhead to 8 bytes, with a 78 byte
  1315. packet carrying an original payload of 1800 uncompressed samples.  The
  1316. outbound data rate is, then, 346 bytes per second, or 2773 bits per
  1317. second.
  1318.  
  1319. 22 March 1996
  1320.  
  1321. Sending nonencrypted packets to multiple hosts in Speak Freely
  1322. protocol on a little-endian machines failed because sendpkt() in
  1323. mike.c didn't undo the htonX() transformations of fields in the sound
  1324. buffer before sending the packet to the next destination host.
  1325.  
  1326. Sending nonencrypted packets to multiple hosts in Speak Freely
  1327. protocol using LPC-10 compression failed because the "packet stuffing"
  1328. done to reduce the number of bytes per packet in LPC-10 protocol was
  1329. not reversed after transmitting a packet to a given host.  Fixed in
  1330. mike.c.
  1331.  
  1332. 23 March 1996
  1333.  
  1334. Sending packets to multiple hosts in LPC-10 robust mode sent invalid
  1335. packets to all but the first host after the first 128 packets had
  1336. been sent.  The "unstuff" code in sendpkt() in mike.c was clearing the
  1337. robust mode sequence number in the buffer.buffer_len field after
  1338. unstuffing, not before as required.  Fixed.
  1339.  
  1340. 24 March 1996
  1341.  
  1342. Integrated the compression type editing code from speaker.c into
  1343. echo.c so the echo server -v connection log will distinguish LPC-10
  1344. from uncompressed packets.
  1345.  
  1346. 6.1-Alpha 1 prerelease.
  1347.  
  1348. 28 March 1996
  1349.  
  1350. To avoid problems with C libraries that don't define nint(), I
  1351. incorporated the round() replacement for nint() from the CELP library
  1352. and modified all the references to nint() in the lpc10 library to use
  1353. L_nint(), which is #defined to round() in lpcdefs.h.  This roundabout
  1354. redefinition allows going back to an inline implementation of nint()
  1355. if that proves important for performance reasons.
  1356.  
  1357. 6 April 1996
  1358.  
  1359. In order to get rid of compiler warnings on Solaris, I added a
  1360. typedef signalFUNC to the signal function type in the #ifdef
  1361. Solaris block in speakfree.h and modified the #define signal()
  1362. for Solaris to cast its second argument to this type.  In
  1363. addition, I added a definition of signalFUNCreturn which casts a
  1364. value to this type on Solaris and is void on other platforms.
  1365. This is used in usleep.c to cast the result of signal().  This
  1366. code may be applicable on other System V platforms, but I'm not
  1367. going to enable it on speculation.
  1368.  
  1369. All of the Speak Freely executables used argv[0] as the program
  1370. name in usage, status, and error messages.  When the program was
  1371. executed with  long explicit path name (as if often the case when
  1372. daemons are started at boot time), this generated a lot of clutter
  1373. in the log file.  I added a prog_name() function which trims all
  1374. but the final executable name from the argv[0] string and uses that
  1375. as the program name.  Sfvod.pl already contained this logic, so there
  1376. was no need to modify it.
  1377.  
  1378. 7 April 1996
  1379.  
  1380. Specifying options (compression modes, for example) on sfvod to be
  1381. passed on to sfmike didn't work since they got appended to the sound
  1382. file name(s) instead of appearing before the -p specification of the
  1383. destination(s).  I modified the command line parser in sfvod.pl to
  1384. distinguish sound file names from post "-" options, assemble them in
  1385. separate strings, and emit the options before the destinations on the
  1386. sfmike command line.  I also added code to echo the command line when
  1387. the "-d" option is set; this makes it easier to debug what's being
  1388. passed to sfmike.
  1389.  
  1390. Added a new "-Wport" option to sfspeaker which causes it to do nothing
  1391. other than publish its identity on an Look Who's Listening server.
  1392. This allows sfvod servers to identify themselves without adding all
  1393. the complexity of direct communications to sfvod itself.  When invoked
  1394. with "-Wport", sfspeaker does not create or bind any inbound sockets.
  1395. This allows it to coexist with other copies of sfspeaker running on
  1396. the same machine regardless of how they were invoked.
  1397.  
  1398. If SPEAKFREE_LWL_TELL is defined, sfvod now forks a process and
  1399. invokes sfspeaker with the -W option to announce the voice on demand
  1400. server to the LWL host.
  1401.  
  1402. Holy proliferating packets, Bitman!  You mean it's possible for one
  1403. user to publish his identity on more than one Look Who's Listening
  1404. server?  That's right, Rotten, now you can list up to five Look
  1405. Who's Listening servers on your SPEAKFREE_LWL_TELL environment
  1406. variable, separated by commas, and sfspeaker and sfecho will publish
  1407. your listing on each server you name.  The limit of five is not
  1408. inherent, just intended to keep people from going off the deep end.
  1409. In addition, the SPEAKFREE_LWL_TELL hosts can be specified by IP
  1410. address as well as host name, for example (sh/ksh syntax):
  1411.  
  1412.   SPEAKFREE_LWL_TELL="lwl.somewhere.net,12.122.85.201,lwl.elsewhere.net"
  1413.  
  1414. This is primarily intended to allow echo and voice on demand servers
  1415. to advertise their existence on multiple regional LWL servers, but
  1416. there's nothing to keep a user running sfspeaker from publishing on
  1417. multiple sites.  Supporting this required installing the multiple site
  1418. scanning and notification code in speaker.c and echo.c, plus a small
  1419. tweak in lwl.c so that if no SPEAKFREE_LWL_ASK variable is set and
  1420. SPEAKFREE_LWL_TELL is used as the default, only the first server in
  1421. the list will be queried.  (Multiple-server LWL queries have their
  1422. merits, but are better hacked in Perl than coded in C.)
  1423.  
  1424. 8 April 1996
  1425.  
  1426. When I added multiple LWL publication to echo.c, I inadvertently broke
  1427. retry of failed LWL connections by echo servers.  Sfspeaker gives up
  1428. on a failed LWL host immediately (to avoid bombarding former LWL
  1429. servers with packets), but echo servers are assumed to be more
  1430. responsible and since they run unattended for long periods of time,
  1431. need to be able to reconnect after an LWL server has been offline for
  1432. a while.
  1433.  
  1434. For the sfspeaker -d option to work with the -w (LWL only) option,
  1435. recognition of the -d option had to be moved to pass 1 option
  1436. processing in speaker.c.
  1437.  
  1438. Tightened up the parsing of multiple hosts on a SPEAKFREE_LWL_TELL
  1439. statement; spaces are now allowed before a host name, and a void entry
  1440. no longer fools inet_addr() into returning an IP address of 0.0.0.0.
  1441. The new code is now used by both sfspeaker and sfecho.
  1442.  
  1443. Added a new optional compile-time definition, AUDIO_BLOCKING, not
  1444. defined by default.  If you define it, the non-Sun (i.e. Linux and
  1445. FreeBSD) code in soundbyte.c will read from the sound card with
  1446. blocking reads.  This should help some drivers which don't handle
  1447. non-blocking I/O.
  1448.  
  1449. Memo to file: the half-duplex transition handshake between sfmike and
  1450. sfspeaker assumes sfspeaker is listening on the standard INTERNET_PORT
  1451. of 2074.  If you've specified a different port with the -Pport option
  1452. on sfspeaker, a half duplex mute request from the local host will be
  1453. ignored.
  1454.  
  1455. 6.1-Alpha 2 prerelease.
  1456.  
  1457. 17 April 1996
  1458.  
  1459. Integrated a fix from Malcolm Beattie for older versions of the C
  1460. library on Linux which do not place the coprocessor into default IEEE
  1461. mode.  This can result in what should be harmless floating point
  1462. underflows in lpc/lpc.c (which default IEEE handling simply rounds to
  1463. zero, as the code intends) crashing sfspeaker with a floating point
  1464. exception instead.  Current libraries are supposed to set IEEE
  1465. operation by defaults and not require this fix.  Since I don't have a
  1466. Linux machine to test this on, even though the fix should be harmless
  1467. on later releases, I made the fix activated only if LINUX_FPU_FIX is
  1468. defined at compile time.  Mike.c and speaker.c now make a
  1469. __setfpucw(_FPU_IEEE) call at initialisation time if LINUX_FPU_FIX is
  1470. defined.  I also added a comment to the Linux section of the Makefile
  1471. describing the circumstances in which the fix should be enabled.
  1472.  
  1473. Bradley Allen pointed out that the "#define int long" in
  1474. lpc10/lpcdefs.h could cause an error if a subsequent system include
  1475. file contained a "short int whatever;" declaration.  This #define
  1476. crept in during a since-abandoned attempt to get lpc10 to work on
  1477. Windows 3.1.  Since all Speak Freely for Unix platforms are 32 bit, I
  1478. just removed the #define.
  1479.  
  1480. Andrey A. Chernov supplied fixes for several build issues noted on
  1481. FreeBSD. The "-static" previously used on the link flags was removed
  1482. for FreeBSD 2.2.  The little ephemeral program that the sfvod build
  1483. process creates in order to discover the settings of AF_INET and
  1484. SOCK_DGRAM on the current system was executed as "sfvod-t" instead of
  1485. "./sfvod-t", as required for people who, for security reasons, don't
  1486. have the current directory in their path.  Finally, the "#define
  1487. const" in libdes/des.h caused lots of warning messages in FreeBSD and
  1488. keeps gcc from replacing library function calls with intrinsics.  I
  1489. made the definition of const to nothing contingent on OLDCC, as is
  1490. already used for SunOS "cc" and other K&R-classic compilers.
  1491.  
  1492. To help diagnose oddities in translation of DES key strings into 56
  1493. bit DES keys, I added code to speaker.c to dump the computed DES keys
  1494. in hex if the -d option is set.  Mike.c already did this.
  1495.  
  1496. 18 April 1996
  1497.  
  1498. The -u output output from sflwl was identifying itself as the server
  1499. program, not the client.  Fixed in lwl.c.
  1500.  
  1501. Some people have started sending huge strings to the sflwld servers,
  1502. some with embedded HTML markup.  These consume lots of space in the
  1503. packets returned to requestors, and may result, for example, in not
  1504. all the echo servers being listed.  I modified lwld.c to prune the
  1505. strings returned to in reply packets to a maximum of 48 characters
  1506. each, dropping HTML markup, redundant white space, and attempting when
  1507. truncation is still required, to do so at a word boundary.  I also
  1508. drop non-ISO characters which may be present.  This affects only
  1509. strings in reply packets--the full information sent by the user
  1510. continues to appear in the HTML active users file.
  1511.  
  1512. Feature release 6.1.
  1513.  
  1514. 23 April 1996
  1515.  
  1516. Integrated FreeBSD and anti-zero-divide fixes for lpc/lpc.c from
  1517. Andrey A. Chernov, and also yet another byte-order fix which caused
  1518. debug traces to show incorrect packet lengths when sending sound files
  1519. on little-endian machines.  I also integrated his suggestion of a
  1520. higher initial correction in the sound file timing code for FreeBSD,
  1521. since most machines which run it are slower than typical workstations.
  1522.  
  1523. Added the ability for Look Who's Listening servers to talk to
  1524. one another, forwarding packets they receive to as many as
  1525. LWL_MAX_SITES (defined in speakfree.h as 5) other LWL servers.
  1526. This will allow weaving the currently-isolated servers into an
  1527. interconnected web so that regardless of which server a user queries,
  1528. he can see users active on all servers which forward to one another.
  1529. Here's how it works; all modifications are to lwld.c.  A new
  1530. "-f" option was added to sflwld, which accepts a comma-delimited
  1531. list of servers (and optional port numbers, preceded by a colon).
  1532. For example:
  1533.  
  1534.     sflwld -flwl.fourmilab.ch,lwl.somewhere.edu,lwl.elsewhere.com
  1535.  
  1536. Any LWL packet received from a host will be forwarded to all the
  1537. hosts named in the forward list.  A forwarded packet is flagged by
  1538. setting the 0x40 bit in the first byte, and contains four extra bytes
  1539. at the end which give the IP address of the originating host.  Packets
  1540. forwarded from other hosts are never, themselves, forwarded: the risk
  1541. of forwarding loops is just too great and would be too difficult
  1542. to track down.  Undoubtedly, a list of intercommunicating public
  1543. servers will be published so operators of a new server will know
  1544. who to forward to and how to publish the existence of their new
  1545. server.  Eventually this may be automated.
  1546.  
  1547. In order for forwarded sites to appear on the destination host, both
  1548. the forwarding and the destination host must be running an sflwld with
  1549. the forwarding code present.  No harm is done, however, by sending
  1550. forwarding messages to a pre-forwarding server--they are simply
  1551. ignored.
  1552.  
  1553. 25 April 1996
  1554.  
  1555. It was possible to crash a Look Who's Listening server by sending
  1556. artfully composed bogus packets.  I added an invisible Gardol shield,
  1557. in the form of an RTCP conformance test, gardol(), in lwld.c which
  1558. first makes sure any packet passes the basic RTCP validity checks of a
  1559. proper header, known payload type, and length within the packet
  1560. matching the number of bytes received (these tests are made after
  1561. forwarded packets are transformed into regular RTCP format).  In
  1562. addition, the RTCP_SDES packet processor now checks for bogus packets
  1563. with no CNAME item and discards them.  Finally, the code that finds
  1564. the SDES, BYE, or APP subpacket in a composite packet makes sure it
  1565. doesn't run off the end of the packet and, if no known subpacket is
  1566. found, discards the packet.
  1567.  
  1568. To avoid repeated "connecting forwarding socket: Connection refused"
  1569. messages when an LWL to which we're forwarding goes down, I changed
  1570. forwardLwlMessage() in lwld.c to only issue the message if the -D or
  1571. -VV options are set.
  1572.  
  1573. The LWL packet validation code unfortunately uncovered a failure
  1574. of the Windows version to strictly comply with the RTP spec.  In
  1575. particular, the RTCP_APP packets sent to the server to request the
  1576. server message and to submit queries were not padded with zeroes to a
  1577. 32 bit boundary--the packet simply terminated after the end of the
  1578. request.  I'll fix this the next time I revise the Windows version,
  1579. but for compatibility with the installed base there's nothing for it
  1580. but to slightly weaken the packet consistency checking to allow this
  1581. specific case to squeak past.
  1582.  
  1583. 28 April 1996
  1584.  
  1585. Andrey A. Chernov pointed out that without a #include <math.h> in
  1586. lpc10/invert.c, some compilers would incorrectly interpret the return
  1587. type of fabs().  Fixed.
  1588.  
  1589. 29 April 1996
  1590.  
  1591. Plugged one more way sflwld could be tricked into aborting.  If a
  1592. connection was made with a bogus protocol ID, the accept() could
  1593. fail, causing lwld.c's main loop to exit.  I changed the behaviour
  1594. when the accept() fails to just ignore the error and go back to the
  1595. accept() to wait for the next connection.
  1596.  
  1597. 2 May 1996
  1598.  
  1599. Integrated a fix from Brian Abernathy for an undefined gethostid() in
  1600. sfmike.  Gethostid() (which is used only to build the session key) is
  1601. emulated by a call to uname() in hp_audio.c.
  1602.  
  1603. 9 May 1996
  1604.  
  1605. The packet validity checking in lwld.c failed to close the accept()ed
  1606. stream socket after rejecting an invalid packet.  This meant one could
  1607. crash sflwld by sending enough bogus packets to exhaust the maximum
  1608. number of open file descriptors.  Fixed.
  1609.  
  1610. 29 May 1996
  1611.  
  1612. Squashed a few more six-leggers that squirmed out during the first
  1613. serious test of intercontinental LWL forwarding.  First of all, the
  1614. close() of the LWL socket in forwardLwlMessage() (lwld.c) was
  1615. misplaced, orphaning a file descriptor when LWL messages were
  1616. forwarded to more than one site, which eventually curtailed forwarding
  1617. when all available file descriptors were consumed.  Fixed.
  1618.  
  1619. The time needed to connect() to a distant LWL server in
  1620. forwardLwlMessage() was long enough for System V to jab its
  1621. tried-and-true EINTR knife between our ribs.  I wrapped a defensive
  1622. do {} loop around the call to silently retry it if the alarm happens
  1623. to ring while it's pending.
  1624.  
  1625. If -D debugging was enabled, the "received forwarded packet from"
  1626. message misleadingly displayed the IP address of the originating site
  1627. rather than the forwarding server.  The message now shows the server
  1628. address, as the text strongly suggests.
  1629.  
  1630. 24 July 1996
  1631.  
  1632. SunOS and Solaris (but not IRIX) systems use the same underlying
  1633. mechanism for sleep() and setitimer().  This means that a call on
  1634. sleep() has the effect of resetting the itimer to the length of the
  1635. sleep.  This caused sfspeaker, when run with the -W ("LWL only")
  1636. option, to transmit its LWL message every 20 minutes rather than the
  1637. intended 10 minutes, and consequently timing out, then restarting
  1638. repeatedly.  I changed the inner loop for "-W" option mode to use
  1639. pause() to wait for timer signals rather than sleep(120).  This seems
  1640. to have fixed things.
  1641.  
  1642. To provide a little more slack in case a message to an LWL server is
  1643. lost, I increased the frequency with which LWL messages are sent in
  1644. speaker.c to one every 5 minutes.  With a 15 minute timeout in sflwld,
  1645. this means three consecutive LWL notifications must fail before a site
  1646. will be timed out.  Previously, failure to contact an LWL site in
  1647. speaker.c caused further transmissions to that site to be abandoned
  1648. for the duration of sfspeaker's execution.  The rationale for this was
  1649. to avoid blindly bombarding down (or former) LWL sites with packets.
  1650. Unfortunately, this "one strike and you're out" policy could cause
  1651. transient failures, such as inability to connect due to network
  1652. congestion or overload on the LWL server, to shut down transmission
  1653. and cause the site to drop off the list at the server.  I modified
  1654. speaker.c to only disable LWL transmissions after LWL_STRIKEOUT (5 by
  1655. default) consecutive failures to contact an LWL host; with
  1656. notification every 5 minutes, this means the host will be dropped only
  1657. if it is down for at least 25 minutes, in which case the problem is
  1658. unlikely to be transient.
  1659.  
  1660. 27 July 1996
  1661.  
  1662. On systems which support POSIX threads (pthread_xxxx), sflwld can now
  1663. be built to run in multi-thread mode by compiling lwld.c with THREADS
  1664. defined.  This has been tested only on Solaris 2.5 so far; you can
  1665. build a signle-thread version of sflwld as before by compiling without
  1666. THREADS defined.
  1667.  
  1668. Multi-thread operation not only dramatically untangles the logic of
  1669. sflwld, it eliminates the bottleneck which could cause slow response
  1670. on heavily-loaded servers, especially those which forward packets
  1671. elsewhere.  Previously, all requests were processed by a single
  1672. thread, with each packet being accepted only after the previous was
  1673. completed.  This meant that a query, for example, would have to wait
  1674. in the request queue until a previous SDES notification had been
  1675. forwarded to all destinations.  Since forwarding is often done to
  1676. geographically remote servers, this could take a long time and have a
  1677. cascade effect when the forwarding destination servers were themselves
  1678. busy.
  1679.  
  1680. With THREADS defined, each request which arrives from the socket is
  1681. processed by its own thread, having no need to wait for anything
  1682. related to other requests.  A critical section lock protects the
  1683. connection list from corruption due to multiple simultaneous updates,
  1684. but this lock is set only during actual updates and scans of the list
  1685. and never remains locked across a network or I/O operation which might
  1686. be time consuming.  Separate processes periodically scan the
  1687. connection list to remove timed-out sites and to update the HTML list
  1688. of active sites, if configured.  For each forwarding destination a
  1689. "forwarder" thread is created, which processes forwarding requests
  1690. from a queue for that specific host.  If the queue exceeds
  1691. ForwarderMaxQ (currently set to 15 messages), messages to that host
  1692. are discarded until the queue falls below that level--this keeps a
  1693. non-responding forwarding destination from causing what amounts to a
  1694. memory leak in sflwld.  Since each destination has its own forwarder
  1695. thread, problems in contacting one or more destinations will no longer
  1696. affect others.
  1697.  
  1698. Lightly-loaded servers that don't forward to remote locations will
  1699. generally work fine without THREADS defined, but if your development
  1700. environment supports POSIX threads, you'll obtain better performance
  1701. for busy servers by taking advantage of multi-thread execution.
  1702.  
  1703. 28 July 1996
  1704.  
  1705. If the log information written by sflwld was redirected to a file
  1706. (for example, to make a connection log), the file was written in
  1707. block buffered mode (stdio's default handling for standard output).
  1708. This caused individual log entries not to be written as they were
  1709. created, but rather in large chunks every now and then.  To allow
  1710. real-time monitoring (with tail -f, for example), I added a call to
  1711. setlinebuf(atdout) in lwld.c to guarantee that standard output is
  1712. always line buffered, even if redirected.
  1713.  
  1714. 2 August 1996
  1715.  
  1716. When lwld.c was compiled for THREADS, failure to transmit a packet to
  1717. a forwarding destination in forwarder_thread() could cause the socket
  1718. file descriptor for the destination to be orphaned, leading, after
  1719. sufficiently many such reverses, to failures all over the place once
  1720. all available file handles were consumed.  I changed the logic in
  1721. forwarder_thread() guarantee the socket is always closed regardless of
  1722. the outcome of the forwarding attempt.
  1723.  
  1724. 8 August 1996
  1725.  
  1726. Reduced the interval of LWL retransmission for sfecho to 5 minutes
  1727. (LWL_RETRANSMIT in echo.c).
  1728.  
  1729. 11 August 1996
  1730.  
  1731. Added logic to lwld.c to plug yet another way for a remote client to
  1732. consume resources within sflwld, eventually causing it to run out of
  1733. file handles and go dark to the outside world.  If compiled with
  1734. THREADS, once a request was accept()ed, a socket file handle was
  1735. allocated for the use of the service_thread.  If a client connected to
  1736. sflwld but never wrote anything to the socket, servicePacket() would
  1737. block indefinitely on the recv() from the socket, tying up its file
  1738. handle forever.  Once enough of these zombies accumulated, accept()s
  1739. would start to fail with out of file handles.  To keep this from
  1740. happening, I added logic in the main loop to make an entry in a linked
  1741. list of ballOstring packets when each thread is created, recording the
  1742. time the thread was created, its thread ID and (for debugging
  1743. purposes), the IP address of the host where the request we're
  1744. servicing originated.  In normal cases, service_thread() dechains this
  1745. item and releases it before exiting with pthread_exit().  If a thread
  1746. hangs, however, timeout_thread() will, upon discovering the thread is
  1747. still waiting for input from the requesting host ServiceThreadTimeout
  1748. seconds (default 60) after the accept(), use pthread_kill() to send
  1749. SIGUSR1 to the service thread.  This will be caught by killserv(),
  1750. which dechains the service thread item, closes the socket (if open),
  1751. and exits the thread.  The head of the service thread list is bshead,
  1752. and the list is protected by the criticial section lock bsLock.
  1753.  
  1754. This fix applies only to multi-thread versions of sflwld; it's worth
  1755. noting that single-thread versions remain vulnerable to this form of
  1756. hang-up, with the even more dire consequence of just ceasing to
  1757. respond.  However, given that single-thread versions have many far
  1758. more serious problems than this, which are inherent in the code, it
  1759. doesn't make sense trying to fix them at this time.  If there is a
  1760. population of people who want to run heavily-loaded LWL servers and
  1761. can't get access to POSIX threads, it would make more sense to design
  1762. a new lwld.c that used fork(), or re-architect the whole mess to run
  1763. off inetd.
  1764.  
  1765. 20 July (Moon Day) 1997
  1766.  
  1767. Added an experimental implementation of jitter compensation to
  1768. speaker.c.  Jitter compensation is enabled with the -J option on
  1769. sfspeaker.  The -J option specifies, by two comma-separated numbers,
  1770. the initial delay and length of silence which resets jitter
  1771. compensation, both in milliseconds, with 250 milliseconds the minimum
  1772. for each.  If no idle time is specified, twice the jitter delay is
  1773. used; if neither delay nor idle time is given, the delay is one second
  1774. and the idle time two seconds.
  1775.  
  1776. For example, to accumulate samples for 3 seconds before starting to
  1777. play, and to reset the jitter timer after 4 seconds of silence, one
  1778. would specify:
  1779.  
  1780.     sfspeaker -j3000,4000
  1781.  
  1782. Jitter compensation is implemented by buffering samples in memory and
  1783. only starting to play them after the jitter delay time has elapsed.
  1784. The implementation assumes the audio output device is capable of
  1785. buffering as many samples as will accumulate during the jitter
  1786. delay--if it does not do this properly, jitter compensation will be
  1787. unusable.  The only alternative to requiring proper buffering in audio
  1788. output would be a multithreaded version of sfspeaker, which would make
  1789. it far less portable than assuming audio output buffering.
  1790.  
  1791. Implemented a rudimentary busy signal facility in speaker.c.  If the
  1792. -B option is specified on the sfspeaker command line, only one
  1793. connection will be accepted at a time.  If another user attempts
  1794. to connect while a connection is active, the command which follows
  1795. the -B option will be executed to notify the caller that the
  1796. sfspeaker user is occupied with another call.  The command must
  1797. be a C printf() format string containing a "%s" phrase at the
  1798. point the IP address of the calling host should be inserted.  If
  1799. no command is specified, the default is equivalent to specifying:
  1800.  
  1801.     sfspeaker -b"sleep 10; sfmike %s busy.au"
  1802.  
  1803. The "busy.au" file is a recording of the busy signal used in North
  1804. America, with the tone repeated four times.  Users should be aware
  1805. that there is no international standard for busy signals, so if you
  1806. communicate primarily with people in your area which uses a different
  1807. telephone busy signal, you might want to use a recording of that tone.
  1808.  
  1809. The ten second sleep is intended to increase the probability a
  1810. half-duplex user will hear the busy signal after sending the
  1811. transmission which triggers it.  After a busy signal is sent to a
  1812. caller, all packets from that host are silently discarded for an
  1813. interval specified by busytimeout in the speaker.c source code, set to
  1814. 60 seconds in the distribution.  After that delay, additional
  1815. connection requests from the host will be processed, resulting either
  1816. in a connection or another busy signal.
  1817.  
  1818. It should be observed that this busy signal implementation continues
  1819. to rely upon the "community of reasonable people" model for which
  1820. Speak Freely was intended.  Since a connection is closed by the remote
  1821. user "hanging up" (quitting sfmike, or closing the connection window
  1822. in the Windows version), a "denial of service attack" is possible in
  1823. which a malicious user connects to the victim and refuses to
  1824. disconnect, thereby blocking other inbound calls.  If you run
  1825. sfspeaker with the -v option (as most users do), you can easily detect
  1826. this by seeing connections rejected by busy signals while a silent
  1827. connection remains active.  Note that the three-minute inactivity
  1828. timeout guarantees that callers whose machines crash will not block
  1829. the receipt of other calls.  If malicious refusal to disconnect
  1830. becomes a problem, a "kill file" facility may be needed.  Amateur
  1831. radio has operated for the better part of a century on the assumption
  1832. some bozo will not block a QSO by sending an unmodulated
  1833. carrier--let's hope, for the moment, that Speak Freely users on the
  1834. Internet will be at least as mature and responsible.
  1835.  
  1836. Some implementations of make and/or shells were baffled by the
  1837. specification of the quoted release number (Relno) definition
  1838. in the Makefile.  I moved this to a separate version.h file, in
  1839. which the version number must appear as the last line, quoted,
  1840. by itself.  This is required so the Makefile can embed the
  1841. version in the sfvod Perl script.
  1842.  
  1843. 21 July 1997
  1844.  
  1845. Swept up some lint in speaker.c.
  1846.  
  1847. Release 6.1c.
  1848.  
  1849. 11 April 1998
  1850.  
  1851. The HTML active sites file created by makeHTML() in lwld.c displayed
  1852. the time and date of the report in UTC, but the last update time in
  1853. the local time of the site.  I changed it to show all times in UTC.
  1854.  
  1855. 12 April 1998
  1856.  
  1857. Completed the first cut of the new conference reflector (reflect.c)
  1858. as described in the manual page sfreflect.1.
  1859.  
  1860. Ported the periodic client-pull refresh (-r option) code from
  1861. reflect.c to lwld.c and added documentation to sflwld.1.  I also
  1862. included the modification to etime() in lwld.c to edit the year in the
  1863. title as reflect.c now does.
  1864.  
  1865. Fixed some lint quibbles in lwld.c; none were serious.
  1866.  
  1867. Added a gimmick at the top of soundbyte.c which allows overriding the
  1868. default name for /dev/audio and specifying different audio device
  1869. files for input and output (the correct one is selected within
  1870. soundinit() depending on the iomode argument).  This allows Linux
  1871. users whose drivers require opening separate /dev/audio and
  1872. /dev/audio1 devices for full-duplex to accomplish this by adding the
  1873. definitions:
  1874.  
  1875.         -DIN_AUDIO_DEV=\"/dev/audio\" -DOUT_AUDIO_DEV=\"/dev/audio1\"
  1876.  
  1877. to the CCFLAGS declaration in the Makefile.
  1878.  
  1879. Updated dependencies in the Makefile.
  1880.  
  1881. 14 April 1998
  1882.  
  1883. Cleaned up timeout and LWL update logic in reflect.c.  The reflector
  1884. inherited some rather confusing timing logic from the echo server,
  1885. which needs precise timing in order to retransmit packets at the
  1886. correct time.  Since the reflector immediately retransmits any
  1887. sound it receives, it doesn't need timing to any better than a second,
  1888. so I ripped out all the potentially unportable microsecond logic
  1889. and replaced it with simple calls on time() and alarm().
  1890.  
  1891. Okay, I finally figured out a mechanism (all right, kludge) that
  1892. permits a user to run the reflector and participate in a conference it
  1893. is mediating all on the same machine.  Here are the ugly details.  The
  1894. fundamental problem is that sfrelect has to bind the audio and control
  1895. ports for the conference in order to receive audio from participants
  1896. and, by doing so, blocks sfspeaker from listening to those same ports
  1897. on the machine running sfreflect.  So, while a user is free to use
  1898. sfmike to transmit to the conference on the machine running sfreflect,
  1899. there's no way following the usual rules to hear the audio from the
  1900. reflector.  Well, if you don't like the rules, *change them*!  Enter
  1901. the "-m" (monitor) option on sfreflect.  This allows you to specify a
  1902. host (and optional port number--the default is the usual Internet_Port
  1903. in the Makefile, usually 2074) to which all audio received by the
  1904. reflector is retransmitted, in addition to the conventionally
  1905. connected hosts.  If you want to reflect a conference on your machine
  1906. and participate at the same time, proceed as follows:
  1907.  
  1908.     1.  Start sfspeaker as usual.  We'll assume you use the
  1909.         standard port of 2074.
  1910.     2.  Start sfreflect specifying the -mHOST option where HOST
  1911.         is your machine's name.  We'll assume you're using the
  1912.         default port of 4074 for sfreflect.
  1913.     3.  Join the conference with "sfmike HOST:4074" where HOST is
  1914.         as above.
  1915.  
  1916. Now consider what will happen.  When you send to HOST:4074, sfreflect
  1917. will not echo that message back to HOST, as it is the originator
  1918. (thank goodness, since that would create an infinite audio loop!), but
  1919. will echo to the host specified by the -m option, which is the default
  1920. port on HOST, where sfspeaker will play the audio.  When others send
  1921. audio, it will also be sent to the monitor host, so with this little
  1922. work-around you can reflect a conference and participate without
  1923. having two separate computers.
  1924.  
  1925. If a monitor site is configured, the reflector also receives control
  1926. port heartbeats from the reflector at the same time they are sent to
  1927. connected hosts.
  1928.  
  1929. It's ugly, but it gets you there.
  1930.  
  1931. 15 April 1998
  1932.  
  1933. Well, almost there.  Running the reflector and joining a conference it
  1934. is mediating on the same machine had some additional ramifications
  1935. which needed to be addressed.  First of all, consider that when sfmike
  1936. is started, pointed at the reflector on the same machine, that will
  1937. cause an entry to be made in the connection table pointing to the
  1938. machine running the reflector.  In the absence of a special case to
  1939. prevent it, this will cause heartbeats to be sent back to the
  1940. reflector itself (keeping it from timing out) and audio received from
  1941. sites other than the reflector to be resent to the reflector itself,
  1942. resulting in duplicate packets and stuttering audio.  I added tests
  1943. in both the heartbeat and audio reflection code to skip sending a
  1944. packet when the destination host is the same as the host running the
  1945. reflector.
  1946.  
  1947. One additional tweak is required in the handling of a monitor host.
  1948. Since we don't want to ever locally sound originating on the local
  1949. machine (which might cause echo or feedback in the full-duplex case),
  1950. a test is needed to avoid forwarding packets originating at the same
  1951. IP address as the monitor host.  Note that while most applications of
  1952. the monitor host will involve the monitor host being identical to that
  1953. running the reflector, this test is correct in the general case.  If
  1954. the reflector is running on a "headless" server with no audio hardware
  1955. and sending monitor packets to a different workstation, we still don't
  1956. want to reflect packets originating at that workstation back to
  1957. itself.
  1958.  
  1959. 16 April 1998
  1960.  
  1961. Added a test for localhost (127.0.0.1) as an alias for the actual IP
  1962. address of the machine running the reflector in each of the three
  1963. places we test to avoid forwarding a packet to ourselves.  I hope I've
  1964. gotten the byte-order independence right on this test, but all the
  1965. machines I've tested it on are big-endian.
  1966.  
  1967. 19 April 1998
  1968.  
  1969. The HTML status documents created by sflwld and sfreflect were
  1970. vulnerable to unquoted HTML control sequences embedded in text
  1971. supplied by users.  While some users took advantage of this to
  1972. include HTML links, others supplied incorrect HTML which caused some
  1973. or all of the balance of the file to be discarded by the browser.
  1974. I added an outHTML() function in the new file html.c which quotes all
  1975. HTML sensitive characters as they are transcribed.
  1976.  
  1977. 23 July 1998
  1978.  
  1979. The lpcdecomp() function in speaker.c was using ntohl()
  1980. instead of ntohs() to extract the uncompressed length from
  1981. the first two bytes of buffer_val.  This may be the source
  1982. of the reports of "deafening static" by Linux users.
  1983.  
  1984. The gsmdecomp() function in speaker.c was missing the required
  1985. ntohs() when extracting the uncompressed length.  This seems
  1986. to have done no harm since the length was immediately fixed by
  1987. the sanity check which follows.  I added the call to avoid the
  1988. need to be saved by the sanity check.  I also extended the
  1989. sanity check to first try a byte swap before forcing the field
  1990. to the full packet length.  This should make speaker.c accept
  1991. either big- or little-endian values in this field.
  1992.  
  1993. To ease the transition from prior releases with the byte
  1994. order bug in GSM packets, I added a variant of the "-t"
  1995. option in mike.c, "-tc", which causes the GSM length field
  1996. to be sent correctly, in network byte order.  This option
  1997. is meaningful only on little-endian machine (since on
  1998. big-endian machines, host and network byte order are
  1999. identical).  Specifying the -tc option allows a little-endian
  2000. Unix host to communicate with a Windows machine or big-endian
  2001. Unix machine running a release prior to 6.1e.  In addition,
  2002. if BYTE_SWAP_DEBUG is defined, a -td option is available which
  2003. unconditionally swaps the bytes in the GSM length field.  This
  2004. was included solely to permit testing the compatibility code
  2005. in speaker.c from sfmike running on a big-endian machine.
  2006.  
  2007. Added the following message when speaker.c fails to open
  2008. audio output in the hope of reducing the puzzlement of
  2009. those plagued with a half-duplex /dev/audio driver:
  2010.  
  2011.     opening audio output device: No such device or address
  2012.     A common cause of this error is a sound board or
  2013.     driver which cannot run in full duplex mode (some
  2014.     boards which are physically capable of full duplex
  2015.     have drivers which cannot run them in this mode).
  2016.  
  2017.     Try uncommenting the line:
  2018.  
  2019.         DUPLEX = -DHALF_DUPLEX
  2020.  
  2021.     in the Makefile, then "make clean", then "make".
  2022.     This will operate your board in half-duplex mode
  2023.     and avoid the conflict which probably caused the
  2024.     error opening audio output.
  2025.  
  2026. 17 September 1998
  2027.  
  2028. Removed an extra argument to a fprintf in debug code in
  2029. speaker.c which was spotted by the SGI C 7.2.1 compiler.
  2030.  
  2031. Release 6.1e.
  2032.  
  2033. 2 March 1999
  2034.  
  2035. The two tests for robust mode packet replication in mike.c
  2036. used lpc10comp function as the conditional for the test instead
  2037. of the lpc10compress flag.  This didn't cause any problem
  2038. since the function name was always equivalent to TRUE and
  2039. "robust" never gets set unless the correct flag, lpc10compress,
  2040. is set.  This error was nailed by the SGI IRIX 6.5 C compiler,
  2041. and is now fixed to use lpc10compress.
  2042.  
  2043. Added Blowfish as an encryption option in sfmike.c and sfspeaker.c,
  2044. with both programs using the "-bf" option to specify the key.  The
  2045. Blowfish library is built in a new blowfish subdirectory.  Blowfish is
  2046. operated in 128 bit mode, with the actual key generated from the
  2047. user-supplied key with the MD5 algorithm.  Since the "-b" option
  2048. was previously used by sfspeaker to specify an arbitrary busy
  2049. signal command, I added a note to the sfspeaker manual page
  2050. observing that in the unlikely event the first character of the
  2051. busy signal command should be "f", one can simply quote the command
  2052. (if not already quoted) and precede it with a space, which the shell
  2053. will ignore.
  2054.  
  2055. I made a slight modification to the Blowfish library to automatically
  2056. set the BF_PTR optimisation flag in blowfish/bf_locl.h if "sparc"
  2057. or "mips" is defined at compile time.  This avoids having to set
  2058. these flags via CFLAGS.  This is only a speed optimisation; the   
  2059. code will work correctly with this variable mis-set.  The code
  2060. recommends defining BF_PTR2 for Intel machines prior to the
  2061. Pentium Pro, again purely as a speed optimisation.  I did not
  2062. attempt to do this, since I know of no preprocessor symbol valid
  2063. on all x86 compilers which allows detecting such processors
  2064. unambiguously.  Further, I made no attempt to use any of the
  2065. assembly language inner loops provided with the code.  Since
  2066. Blowfish encryption and decryption is so fast (once the key has
  2067. been generated, which only happens once per execution of sfmike
  2068. and sfspeaker) compared to GSM, LPC, or LPC-10 compression,
  2069. even without perfect optimisation settings Blowfish will account
  2070. for a very small fraction of the CPU time per packet.
  2071.  
  2072. 3 March 1999
  2073.  
  2074. Added documentation for Blowfish encryption to the sfmike.1 and
  2075. sfspeaker.1 manual pages and cleaned up some awkward phraseology which
  2076. had accreted over the years.
  2077.  
  2078. Sfvod, which works perfectly fine on Perl 4.036, failed on Perl 5.004
  2079. in a bizarre manner which took the better part of a day to track down.
  2080. The problem ended up being a stone bug in Perl 5.004: if a signal
  2081. was processed while blocked in recv() waiting for a packet to arrive,
  2082. when the next packet was received, recv() would return the null string
  2083. for the sender's address, even through the data for the packet was
  2084. properly stored into the string argument.  I happened to notice that
  2085. the UDP example program in "Programming Perl, 2nd ed." did not block
  2086. on recv() but instead called select()--it had to, since it was waiting
  2087. on multiple clients.  Okay, I thought, let's use a totally unnecessary
  2088. select() (since sfvod listens only to one socket) and see if that
  2089. works around the bug.  Damned if it didn't, and the modified code
  2090. works on both Perl 4 and 5.  I thought about using the timeout feature
  2091. in select() to replace the existing alarm() mechanism (it would be
  2092. safer, as &tick() would always be called in a known environment), but
  2093. the Perl manual warns that you can't be sure select() will return
  2094. a valid time left value on all platforms, which could potentially
  2095. cause the timeout to be disabled due to inter-packet arrival times
  2096. less than the tick interval.
  2097.  
  2098. 4 March 1999
  2099.  
  2100. I added a "text chat" feature to mike.c and speaker.c to allow people
  2101. to send text messages while they're trying to establish a reliable
  2102. audio link (or for any other reason).  When you're running in push
  2103. to talk mode in sfmike, pressing the period (.) key now displays a
  2104. "Chat:" prompt, pausing audio transmission if it was in progress.
  2105. The user can then enter a line of text in regular input mode, and
  2106. when Return is pressed, the text is sent to all destinations on
  2107. the control port as an RTCP APP message with type "SFtc".  Upon
  2108. receiving such a message, sfspeaker prints its content on standard
  2109. output, prefixed with the best available information about the sender,
  2110. in decreasing order of preference: user name, E-mail address, host
  2111. name, and IP address.
  2112.  
  2113. Previously, speaker.c didn't bother to decode the identity information
  2114. in RTCP SDES packets unless the option to show connections was set.
  2115. Since this information may be needed to identify senders of text
  2116. chat packets, I modified it to always decode SDES packets.  The
  2117. overhead is negligible.
  2118.  
  2119. The loop-back mode in speaker.c contained obsolete logic to compute
  2120. packet length which resulted in its sending extra bytes at the end
  2121. of the packet returned to the sender.  This ran afoul of the packet
  2122. length sanity check in the recipient's sfspeaker, causing the packet
  2123. to be discarded.  Fixed.
  2124.  
  2125. For some screwball reason I can't make head or tails of, if you quit
  2126. sfmike while in talk mode on Silicon Graphics IRIX 6.5, not only
  2127. does Speak Freely exit but the Winterm you're running it under
  2128. also quits, closing the window where you're running sfmike.  This
  2129. does not happen on Solaris, nor does it happen if you run sfmike
  2130. under the SGI debugger.  I've tried all the obvious things, including
  2131. completely simulating transition back to pause mode and waiting
  2132. 10 seconds before exiting, but at the moment the exit() is executed,
  2133. bye-bye Winterm.  Precisely the same thing happens if you run sfmike
  2134. under xterm, or under csh or sh instead of ksh.  However, if you run
  2135. sfmike with the "-a" option (always transmit), and kill it with
  2136. Control C in mid-transmission, everything shuts down just fine.
  2137. Beats me.  Well, after another hour of flailing around, I discovered
  2138. that moving the fcntl(fileno(stdin), F_SETFL, 0) which sets stdin
  2139. back into blocking I/O mode after the call to switch back to
  2140. cooked mode rather than before fixes the disappearing shell window
  2141. problem.  Sigh.  If you need to revisit this, look at function
  2142. exiting() in mike.c.
  2143.  
  2144. Updated sfmike.1 and sfspeaker.1 manual pages, and revised the
  2145. introductions to each to be more generic in terminology across
  2146. various Unix platforms.
  2147.  
  2148. 5 March 1999
  2149.  
  2150. Fixed a typo (actually, a blind-copy-o) in speaker.c's how-to-call
  2151. text; in sfspeaker, the -BF option decrypts, not encrypts.  (Spotted
  2152. by RZG).
  2153.  
  2154. Release 6.1f.
  2155.  
  2156. 5 April 1999
  2157.  
  2158. Fixed a harmless extra argument on the SHOW_SOCKET fprintf debug
  2159. code in echo.c.
  2160.  
  2161. Implemented fixes to lpc/lpc.c forwarded by Enzo Michelangeli.
  2162. These should eliminate distortion primarily due to overflows in
  2163. computing parameters.  LPC still doesn't sound great, but it
  2164. shouldn't break up so badly due to clipping.  These fixes
  2165. interoperate with no problems with pre-fix LPC CODECs so there's
  2166. no problem earlier versions.
  2167.  
  2168. 6 April 1999
  2169.  
  2170. The current version and release date is defined in version.h, which
  2171. was included in speakfree.h to make it available to each main program.
  2172. This created a Makefile dependency of speakfree.h on version.h, which
  2173. created the curious situation that if you updated version.h and did
  2174. not modify speakfree.h, every program which included speakfree.h would
  2175. be rebuilt on every make.  I modified each program which actually
  2176. needs the version (echo.c, lwl.c, lwld.c, mike.c, reflect.c, and
  2177. speaker.c) to explicitly include version.h, removed the include of it
  2178. from speakfree.h, and updated the dependencies in the Makefile to
  2179. reflect these changes.
  2180.  
  2181. Release 6.1g.
  2182.  
  2183. 2 May 1999
  2184.  
  2185. Text chat messages sent to a reflector operated by sfreflect caused it
  2186. to crash attempting to interpret the RTCP APP message as an SDES.
  2187. Added code to reflect.c to detect text chat packets received on the
  2188. control port, reformat them to embed the sender's identity in the text
  2189. area (since otherwise they'll contain only the identity of the
  2190. reflector), and retransmit them to the control port of all connected
  2191. hosts (and the monitoring host, if any).
  2192.  
  2193. Added code to soundbyte.c, conditional on LINUX_DSP_SMALL_BUFFER,
  2194. which attempts to limit the input sound buffer size to 2048 bytes.
  2195. I have not personally tested this code and LINUX_DSP_SMALL_BUFFER
  2196. is not defined by default.
  2197.  
  2198. Release 6.1h.
  2199.  
  2200. 17 May 1999
  2201.  
  2202. Redesignated as Release 7.0 to synchronise with Windows release.
  2203. Other than the version change, there are no changes in this release.
  2204.  
  2205. Release 7.0.
  2206.  
  2207. 25 August 1999
  2208.  
  2209. Added a -w option to mike.c which dumps raw audio input to a
  2210. binary file.  This is intended to facilitate debugging of audio
  2211. input hardware which requires special settings to produce input
  2212. in the 8000 sample per second 8 bit mu-law encoding expected by
  2213. sfmike.
  2214.  
  2215. 30 August 1999
  2216.  
  2217. Integrated code from Jean-Marc Orliaguet to support Linux (and
  2218. other platform) audio hardware which doesn't support 8 bit
  2219. mu-law audio.  Defining LINEAR_NEEDED includes code which translates
  2220. on the fly between 16 bit PCM and mu-law.  As I have no audio hardware
  2221. which requires this, this code has not been tested other than to
  2222. verify that it compiles correctly when enabled.
  2223.  
  2224. Integrated code from Jean-Marc Orliaguet to add a new "-e" option
  2225. to sfspeaker.  When a new connection is opened, the argument to
  2226. the "-e" option is executed as a command, with the character sequence
  2227. "%s" replaced by the hostname of the connecting hosts.  One might,
  2228. for example, answer calls automatically with:
  2229.  
  2230.     sfspeaker -e"killall sfmike >&! /dev/null; sfmike %s"
  2231.  
  2232. 31 August 1999
  2233.  
  2234. The half-duplex muting code which coordinates handing the
  2235. audio device back and forth between sfmike and sfspeaker was
  2236. unnecessarily looking up the local host's name and IP
  2237. address, which could fail under certain bizarre circumstances.
  2238. I modified it to use the standard local loopback address of
  2239. 127.0.0.1 which, in the interest of paranoia, I supplied
  2240. definitions for in mike.c and speaker.c in case some
  2241. screwball system doesn't define it in <netinet/in.h> as it's
  2242. supposed to.
  2243.  
  2244. Turned off code in mike.c introduced in release 6.1e to transition
  2245. from the incorrect GSM byte order sent by little-endian platforms
  2246. prior to that release.  To send the correct byte order, you needed
  2247. to use the -TC option on sfmike.  Now that almost everybody is
  2248. running versions which understand the corrected byte order, this
  2249. has been made the default.  If you absolutely have to transmit to
  2250. a Unix user running an older version on a little-endian platform,
  2251. you can specify "-TD" to force the old, incorrect, byte order.
  2252.  
  2253. Release 7.0b.
  2254.  
  2255. 1 September 1999
  2256.  
  2257. Added a test in mike.c for failure of gethostname().  If a system is
  2258. sufficiently misconfigured that it can't obtain its own host name,
  2259. we just call it "localhost" rather than in all likelihood crashing
  2260. due to an uninitialised value for the host name.
  2261.  
  2262. Removed obsolete "OLD2X" compression code in mike.c and speaker.c.
  2263. It's not like we were going to re-enable "mumble mode" compression
  2264. some day.
  2265.  
  2266. Removed conditional code in mike.c based on definition of
  2267. TINY_PACKETS.  This definition has been required for years, and
  2268. the code which predated it was obsolete and confusing in some
  2269. places.
  2270.  
  2271. The new files common.c and common.h, added by Jean-Marc Orliaguet
  2272. to support the "-e" option in sfspeaker (execute command on
  2273. connection) contained ANSI C function declaration syntax.  I
  2274. downgraded this to K&R to maintain the tradition that Speak
  2275. Freely can be built even on ancient versions of SunOS which
  2276. don't come with an ANSI compiler.  I added a #include of common.h
  2277. to speakfree.h, which allowed dispensing with the explicit
  2278. (and potentially dangerous, as pointer and integers need not
  2279. have the same length) casts in speaker.c.  The code which expanded
  2280. the reply command did not check for failure to allocate the expanded
  2281. command and didn't release the dynamically allocated command buffer,
  2282. creating a memory leak on each connection.  Fixed.
  2283.  
  2284. Changed des/ and idea/ from object files explicitly linked into
  2285. sfmike and sfspeaker to libraries like the other crypto packages
  2286. (libdes/ and blowfish/).
  2287.  
  2288. Added the ability to build no-crypto versions of sfspeaker and sfmike
  2289. (the only components of Speak Freely for Unix which include encryption
  2290. code).  If "NOCRYPTO" is defined at compile time, speakfree.h will not
  2291. define the symbol "CRYPTO" on which all encryption code in mike.c and
  2292. speaker.c is now conditional.  At link time, the various encryption
  2293. libraries will not be pulled in since no references to them appear
  2294. in the main programs.  On non-crypto builds the how-to-call
  2295. instructions (-u option) on sfmike and sfspeaker identify themselves
  2296. as non-crypto versions and provide the URL from which full crypto
  2297. source code can be obtained.  In addition, if the non-crypto version
  2298. of sfspeaker receives encrypted audio, it emits a warning (once per
  2299. connection) which explains why it is unable to decode the audio and
  2300. again directs the user to the URL for a full crypto edition.
  2301.  
  2302. The rationale for the non-crypto version is precisely the same as
  2303. motivated the creation of the non-crypto Windows edition; it permits
  2304. the creation of ready-to-run binaries for widely used platforms such
  2305. as Linux and FreeBSD which can be freely distributed without concern
  2306. for export controls and other regulations on encryption technology.
  2307. Once a user installs such an edition and gets it to work transmitting
  2308. in the clear (which one should do in any case before experimenting
  2309. with encryption), they can then download a version with encryption
  2310. and replace the binary they initially received.
  2311.  
  2312. Note that non-crypto builds apply only to *binary* distributions
  2313. of Speak Freely.  Any source distribution includes all of the
  2314. encryption modules and must be treated as cryptographic software.
  2315.  
  2316. Integrated fixes from  Walter Haidinger (walter.haidinger@gmx.at) 
  2317. to provide fine-grained control over the size and number of buffers
  2318. used by the Linux OSS audio input driver.  If LINUX_DSP_SMALL_BUFFER
  2319. is defined, you may now also specify:
  2320.  
  2321.     FRAGMENT_BUFSIZE=32
  2322.     FRAGMENT_BUFPOWER=8
  2323.  
  2324. which set the size of individual audio input "fragments" to
  2325. (2 ^ FRAGMENT_BUFPOWER) and the number of fragments in the
  2326. overall buffer FRAGMENT_BUFSIZE.  Mr. Haidinger reports that the
  2327. values given above result in about one second of audio delay with
  2328. no lost audio on his configuration.  Note that these settings have
  2329. no effect whatsoever unless LINUX_DSP_SMALL_BUFFER is also
  2330. defined.  See the Makefile Linux configuration section for
  2331. additional details, and the README.Linux_OSS_bufsize document for
  2332. an in depth explanation.
  2333.  
  2334. Integrated code from Walter Haidinger to add an "install" target
  2335. to the Makefile.  I set the default installation target directory
  2336. tree to /usr/local.  Binaries and manual pages are installed under
  2337. root:root with permissions of 755 and 644 respectively.  Note that
  2338. you may have to edit the path for the INSTALL program at the
  2339. top of the Makefile.
  2340.  
  2341. Changed the default path to Perl in the Makefile to /usr/bin/perl.
  2342. This seems more common these days that the prior setting of
  2343. /usr/local/bin/perl.
  2344.  
  2345. Removed some OBSOLETE-flagged code from vatpkt.c.
  2346.  
  2347. Removed some OLDWAY-flagged code from rtpacket.c handling LPC
  2348. compressed RTP messages.
  2349.  
  2350. Release 7.0c.
  2351.  
  2352. 13 September 1999
  2353.  
  2354. Fixed a typo in a debug message related to busy signal generation
  2355. in speaker.c.
  2356.  
  2357. Completed the first cut of sflaunch (launch.c), which opens the
  2358. audio device in O_RDWR mode and then executes sfmike and sfspeaker
  2359. in two child processes, passing the audio I/O and control file
  2360. descriptors to them with the -y# option.  This allows working around
  2361. audio device drivers which don't allow two separate programs to
  2362. open the audio device simultaneously, even if one opens read-only
  2363. and the other write-only.  (Which remains, in my opinion, a
  2364. stone bug.  Why should audio input and output have anything to
  2365. do with one another, necessarily, and why must both be owned
  2366. by the same program?)  Anyway, sflaunch should allow those with
  2367. such drivers to run Speak Freely.
  2368.  
  2369. 14 September 1999
  2370.  
  2371. Removed a redundant definition of BUFL in soundbyte.c.  It is
  2372. defined in speakfree.h, which soundbyte.c includes.
  2373.  
  2374. Removed the confusing SGI audio driver from the end of soundbyte.c
  2375. and placed it in its own file, audio_sgi.c.  Renamed the former
  2376. hp_audio.c to audio_hp.c.  The intent is that all future drivers
  2377. for non-device-file audio will be named audio_something.c.  Now
  2378. each driver only contains one set of the audio interface functions.
  2379.  
  2380. Several Speak Freely source files used the <ctype.h> functions
  2381. such as isspace(), tolower(), but there was no include of <ctype.h>
  2382. in speakfree.h.  Fixed.  (This didn't cause a problem on any known
  2383. platform, but it generates lint natters.)
  2384.  
  2385. In half duplex mode, mike.c did not call soundflush() on the first
  2386. transition between Pause and Talk mode.  On some platforms,
  2387. particularly Solaris (which has a large input buffer), this
  2388. could cause in a long transmission of sound received before
  2389. the user made the switch to talk mode.  Fixed.
  2390.  
  2391. Release 7.0d.
  2392.  
  2393. 15 September 1999
  2394.  
  2395. Added g711.o to the list of object files required to build sflaunch
  2396. when -DNEEDED_LINEAR is defined.  (Fix supplied by Jean-Marc
  2397. Orliaguet.)
  2398.  
  2399. 18 September 1999
  2400.  
  2401. Fixed a couple of typos and troff formatting uglies in the manual
  2402. page sflaunch.1.
  2403.  
  2404. Made Linux the default settings in the Makefile.
  2405.  
  2406. The "closing audio device" debug message at the end of launch.c
  2407. appeared even if the -d option was not specified.  Fixed; I didn't
  2408. notice this until testing on Linux since the message is only
  2409. compiled in when AUDIO_DEVICE_FILE is defined, and I'd been
  2410. testing on SGI, which does not define this flag.
  2411.  
  2412. Release 7.1.
  2413.